Live data from Hacker News

Rest-client gem is hijacked

github.com

21–30 of 113 posts

Re: Rest-client gem is hijacked

#21

It's worth noting that the hijacker pushed a malicious version of 1.6.x Version 1.7.0 was released to rubygems on 8th July 2014, and 2.0.0 on 2nd July 2016, so anyone who has started using rest-client or run a `bundle update` recently is unlikely to be affected. The impact could have been significantly greater had the hijacker pushed a new versions of 1.8.x or 2.x as well, so it's very fortunate the breach was spotte…

That's a good point. Could indicate a targeted attack?

Re: Rest-client gem is hijacked

#23
This is bad. Also from the Github comments, here's a useful snippet to quickly search your projects to see if any of your projects are impacted[0]:

  cd ~/code # Where all my projects live
  grep --include='Gemfile.lock' -r . -e 'rest-client \(1\.6\.1[0123]\)'
https://github.com/rest-client/rest-client/issues/713#issuec...

Re: Rest-client gem is hijacked

#24

It's worth noting that the hijacker pushed a malicious version of 1.6.x Version 1.7.0 was released to rubygems on 8th July 2014, and 2.0.0 on 2nd July 2016, so anyone who has started using rest-client or run a `bundle update` recently is unlikely to be affected. The impact could have been significantly greater had the hijacker pushed a new versions of 1.8.x or 2.x as well, so it's very fortunate the breach was spotte…

Yeah; I just grepped all of my own repos, it's quite out of date thankfully.

This situation definitely lends itself to push for 2FA by default on all rubygems.

Re: Rest-client gem is hijacked

#26
post #15
post #6

Earlier quoted context omitted.

Unless the attacker had very poor OpSec, it would be hard to track them down, even assuming the relevant police force had the skills/manpower to do so. Then you get the delight of likely jurisdictional issues, if it turns out the attacker is not a resident of the same country as the victim that reported it.

It's also likely it was done by an intelligence agency.

Not really. The attacker seemed to target bitcoin once again... surprising this shit is still profitable, though.

Re: Rest-client gem is hijacked

#27
post #2

I think that rubygems should consider automatically enforcing multifactor authentication for popular gems. So any gem with more than 50,000 downloads should force to gem maintainer to have MFA set up before they can publish a new version or do anything with that gem. Because, having MFA is not about protecting gem maintainers, it's about protecting users. So, gem maintainers should not be allowed to be careless with…

Or just any gem, period, regardless of download count? Seems like a fair minimum baseline for publishing to a public repository. MFA in modern times is low-effort.

Re: Rest-client gem is hijacked

#28

Earlier quoted context omitted.

Why would a CI/CD need to permissions modify and commit code to a repo?

Say your CI pipeline runs automated tests, builds the gem and pushes to Rubygems, it needs permissions to push to Rubygems. So if an attacker compromises the API key used by that pipeline, they get the rights to push to Rubygems.

Actually publishing new versions seems like something that happens infrequently enough that it would be fine to require a manual auth to complete it. Given the potential risks it seems prudent.

Re: Rest-client gem is hijacked

#29

It looks pretty bad if you had deployed this :( Here is a summary of the exploit re-pasted from a great comment [1] written by @JanDintel on the github thread: - It sent the URL of the infected host to the attacker. - It sent the environment variables of the infected host to the attacker. Depending on your set-up this can include credentials of services that you use e.g. database, payment service provider. - It allow…

Not only the data could be accessed, it's entirely possible it was modified. Unless you have good logging of all data changes (at DB level) it can be very difficult to detect these changes.

The first hijacked version was released on August 13th.

Post reply on HN