Open Source 2019-08-14 · 5 days ·Data Exfiltration, Remote Code Execution

rest-client gem backdoor stole credentials

A reused maintainer password let attackers publish rest-client 1.6.10-1.6.13 to RubyGems. Production Rails apps could fetch Pastebin code and leak secrets.

Story

rest-client was an old, widely used Ruby HTTP client. In August 2019, attackers used a compromised RubyGems maintainer account to publish malicious releases in the 1.6 line, a branch old enough to avoid immediate attention but still present in real applications.

The weak point was ordinary password reuse. Sonatype cited the project thread: the maintainer had not logged into RubyGems in years, and the account password had appeared in an older breach. The attacker did not need the GitHub repository; registry publishing rights were enough.

The backdoor activated in Rails production environments. It fetched Ruby code from Pastebin, executed it, and sent host URLs and environment variables to attacker infrastructure. Sonatype's summary also noted a cookie-triggered path that could evaluate attacker-supplied Ruby code and expose authentication data in affected applications.

RubyGems yanked the malicious releases, locked the compromised account, and the project released 1.6.14 to supersede the poisoned 1.6.x builds. The attack was small in downloads, roughly one thousand by the project thread, but large in lesson: a stale dependency line is not inert if it still resolves from the registry.

Affected Artifacts

rest-client

· repository · Source Archive
Observed
2019-08-14 to 2019-08-19
Compromised Versions
  • 1.6.10
  • 1.6.11
  • 1.6.12
  • 1.6.13
Fixed
Not listed
Hashes
  • sha256:9900a959f1ebf2a27e45f5a9ebff2440edc7a91181e4aae2d3c89dd03dca3dfe
  • sha256:cca62351eceaebe5ba440a8fc00a3170a58e0af67a755d2bce743c11a2b1437e
  • Versions 1.6.10 through 1.6.13 were malicious; version 1.6.14 was released to supersede the affected legacy 1.6.x line.

Incident Context

Motive
Financial Gain
Attribution
Person
Cause
Compromised Account Credentials
Transitive
No
Actor
Individual Hacker
User Impact
1000

External References

Source record: oss/attacks/rest-client/meta.yaml