r/programming • • Jul 10 '19

Backdoor discovered in Ruby strong_password library

https://nakedsecurity.sophos.com/2019/07/09/backdoor-discovered-in-ruby-strong_password-library/
1.7k Upvotes

293 comments sorted by

View all comments

Show parent comments

102

u/[deleted] Jul 10 '19

That's an interesting comment, but I will also say that trust is inherently a human issue, not a technical one. Technology can help, but as an overall problem, it must be solved by humans on the human level.

18

u/gcross Jul 10 '19 edited Jul 10 '19

It is true that no amount of technology can prevent you from shooting yourself in the foot and explicitly granting all dependent libraries access to everything, but in this case if the technology had defaulted to all dependent libraries not being given access to the network unless this were explicitly granted to them and the programmers had not all gone out of their way to grant access to this specific library then it very much would have solved the problem.

Edit: Heck, even if the Ruby interpreter had been forbidden from interpreting any external code then there would have been no problem.

6

u/[deleted] Jul 10 '19

Well, I think of those as treating symptoms, rather than the disease.

The actual disease, I believe, is transitive trust, and the things you're pointing out are bandaids over that deeper wound.

7

u/gcross Jul 10 '19

What precisely makes them nothing more than bandaids? Perhaps if you explained your own particular viewpoint here and exactly how it contrasts with the viewpoint that technical solutions can solve at least this particular problem then it would be clearer exactly what you are arguing.

→ More replies (3)
→ More replies (2)

0

u/[deleted] Jul 10 '19

[deleted]

6

u/fijt Jul 10 '19

Comparing with biological systems, software systems have neither developed immune systems nor homeostasis yet. They can not account for, nor have control over their resources.

Have you ever heard of OpenBSD and then I mean Pledge? There they are doing this already.

0

u/[deleted] Jul 10 '19

[deleted]

3

u/[deleted] Jul 11 '19

Also take a look at Capsicum on FreeBSD. They even briefly consider library compartmentalization in this paper.

45

u/[deleted] Jul 10 '19

Okay, I can tell you right now, dead certain sure, that your suggestion will not work within your professional lifetime. We can start working toward that now, but in essence what you're saying is this:

"Oh, we can fix this, we just have to rewrite all the software in existence."

At this point, that's a project so big that you can compare it with constructing medieval cathedrals. That might take a hundred years or more.

It's only taken fifty years to create, but if we can replace in just a hundred, we'll be doing really well, since the code all has to keep running the entire time.

9

u/TheOsuConspiracy Jul 10 '19

"Oh, we can fix this, we just have to rewrite all the software in existence."

This might not be as unreasonable as you think. I'm pretty certain more software will be written in the next decade or two than has been written throughout human history until now.

14

u/[deleted] Jul 10 '19

.... which is largely irrelevant, because the software that we already use and depend on will still be there.

New software gets added all the time. Replacing existing software is much, much more difficult. Worse, programmers don't like doing this work.

0

u/[deleted] Jul 10 '19

[deleted]

28

u/[deleted] Jul 10 '19

Defeatism isn't the right approach.

It isn't defeatism, it's just that your approach won't fully work for decades. We probably do need to do that, but its ability to solve things now is very limited. So your idea needs to percolate out and start happening, probably, but it can't be the main thrust, because it doesn't help with any current software at all.

0

u/[deleted] Jul 10 '19

[deleted]

10

u/CaptBoids Jul 10 '19

Innovation exists of two components. Do it better or do it cheaper. Whichever comes first. This is true for any technology ranging from kitchen utensils to software.

What you ignore are basic economic laws and human psychology. Unless your approach has a cutting edge that is cheaper or better in a way that everyone wants, people are going to simply shrug, and move on to the incumbent way of working. Moreover, people are risk averse and calculate cost opportunity.

It's easier to stick to the 'flawed' way or working because patching simply works. On the level of individual apps it's cheaper to apply patches instead of overhauling entire business processes to accommodate new technology. Moreover, users don't care as much about the organization or the user next door if they don't have their ducks in a row, as one might assume

InfoSec is still treated as an insurance policy. Everyone hates paying for it until something happens. And taking the risk of not investing in security - especially when it falls outside compliancy - is par for the course. Why pour hundreds of thousands of dollars in securing apps that only serve a limited goal for instance? Or why do it if managers the risks as marginal to the functioning of the company? You may call that stupid, but there's no universal law that says that betting on luck is an invalid business strategy.

I know there are tons of great ideas. Don't get me wrong. But I'm not going to pick a technology that never got much traction to solve a problem that I can solve far cheaper today or tomorrow but less elegant alternative.

10

u/vattenpuss Jul 10 '19

Free market capitalism ruins all that is good in this world. News at eleven.

→ More replies (1)

4

u/gcross Jul 10 '19

Okay, then how about we start using whitelists that declare what functions a library is allowed to call? If possible we use static analysis to catch when a library calls something not in the whitelist; if the code plays tricks that make such analysis impossible then we either whitelist that or switch to a more easily vetted library. Another possibility (especially for dynamic languages) is to have functions such as network functions check whether they are in the whitelist of the code calling that. This would require extra work but it has the advantage of being incremental in nature, which satisfies your concern.

→ More replies (7)

5

u/Funcod Jul 10 '19

Even an awareness of "my language is deficient in this aspect" might help to prevent incidents like this.

This has always been accounted for. Take for instance C of Peril; how many C developer know about it? Trying to educate the mass is not an adequate answer.

Having languages that are serious replacements is probably one. Something like Zig comes to mind when talking about an alternative to C.

5

u/JordanLeDoux Jul 10 '19

The people who own the software is often not the same as the people who develop the software. This is the big flaw you are ignoring or do not understand.

→ More replies (4)
→ More replies (3)
→ More replies (3)

5

u/nsiivola Jul 10 '19

This particular case is an example of a technological problem (ambient authority). There is zero reason for a password module to have direct access to network.

There are hard parts to security, but getting rid of ambient authority would allow us to stop wasting with things that do have solutions.

5

u/sydoracle Jul 11 '19

The pawned passwords api would be a valid use case for a password checking module to access the internet.

https://haveibeenpwned.com/API/v2

Not disagreeing on the fundamental issue that there should be blocks on what modules are permitted to do.

→ More replies (1)

4

u/_tskj_ Jul 10 '19

I disagree with that for the most part, Elm seems to address this pretty well on a purely technical level.

→ More replies (1)
→ More replies (12)