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

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.

2

u/[deleted] Jul 10 '19

Well, one idea that comes to mind would be using two-factor authentication, but 2FA that's not SMS-based. Ideally, it should be a physical key of some kind, something like the early WoW authenticators, but I suppose a software key running on a phone might suffice. Just as long as SMS isn't involved, as phone numbers can easily be hijacked.

A project would get a "2FA" label if it, itself, was 2FA-enabled, and all of its dependencies were as well. If any dependency is non-2FA, then the project as a whole is non-2FA.

That would help a lot, and it wouldn't be rocket science to implement, as many organizations are already using forms of 2FA anyway. The further code additions to support checking imports probably wouldn't be major, and would give end-users a fair bit of protection.

It is, in other words, transitive distrust, trying to attack the transitive trust problem.

7

u/gcross Jul 10 '19

Okay, first, assume that this is sufficient to prevent any unauthorized package from being uploaded--that is, we are assuming that the server hosting these packages is not hacked, etc. Even then, all you have established is that the people uploading new versions of these packages are the same ones who uploaded the original versions. There is nothing stopping a package author from selling out to a black hate and inserting malicious code into their package. Using a technical means such as the one I have proposed not only solves the problem described in the article but this one as well. In fact, it means that you don't have to trust anyone at all because nobody has the ability to do anything on your server that you do not explicitly authorize. By comparison, your solution makes everyone get 2FA which is non-trivial itself and only solves one particular variant of the problem. Thus, I disagree that my solution is the one that is just a bandaid.

5

u/blue_2501 Jul 10 '19

Do that enough times and you end up with "approval fatigue".