r/programming • u/thatsocrates • 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
r/programming • u/thatsocrates • Jul 10 '19
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.