No REST for the wicked: Ruby gem hacked to siphon passwords, secrets from web devs

No REST for the wicked: Ruby gem hacked to siphon passwords, secrets from web devs

Developer account cracked due to credential reuse, source tampered with and released to hundreds of programmers


An old version of a Ruby software package called rest-client that was modified and released about a week ago has been removed from the Ruby Gems repository – because it was found to be deliberately leaking victims' credentials to a remote server.


Jussi Koljonen, a developer with Visma in Helsinki, Finland, discovered the hacked code in rest-client v1.6.13, and opened an issue to discuss the matter on the GitHub repo for the software. The gem, originally intended to help Ruby developers send REST requests to their web apps, was altered to fetch malicious code from pastebin.com that steals usernames, passwords, and other secrets from the client's host machine.


According to Jan Dintel, a developer with Digidentity in The Hague, Netherlands, when the infected client is used to send a REST request to a non-localhost website, the malware siphons off the URL of that site along with environment variables that may include authentication tokens, API keys, and other secrets you really don't want in the wrong hands. These details can be reused by the malicious code's mastermind to hijack the victims' accounts.


It also allowed arbitrary Ruby code to run on the infected host, and overloaded the #authenticate method in the Identity class to obtain and leak the user's email address and password every time the function is called to log into a service.


Malicious code ousted from PureScript's npm installer – but who put it t ..