rest-client 1.6.10 through 1.6.13 on RubyGems carried a code-execution backdoor, published on 14 August 2019.
The CVE is CVE-2019-15224. The bad releases had about 1,000 downloads.
What happened
An attacker used a maintainer's RubyGems account to publish four malicious releases. The account had a reused password that leaked in other breaches.
- The backdoor ran only when a Rails app started in production.
- It waited 900 seconds, then fetched Ruby code from a Pastebin URL and ran it.
- It sent data to
mironanoru.zzz.com.ua. - It tried to take credentials from session cookies and to send environment variables.
A researcher reported it on 19 August 2019. RubyGems yanked the versions and locked the account that day.
Affected versions
rest-client1.6.10, 1.6.11, 1.6.12 and 1.6.13. Yanked from RubyGems.- Safe: 1.6.9 or earlier, and 1.6.14 or later. The GitHub advisory also names 1.7.0.
- Other gems from the same attacker:
- cron_parser 1.0.13 and 1.0.14.
- bitcoin_vanity 4.3.3.
- lita_coin 0.0.3.
- coming-soon 0.2.8.
- omniauth_amazon 1.0.1.
- awesome-bot 1.18.0.
- doge-coin 1.0.2.
- capistrano-colors 0.5.5.
- coin_base and blockchain_wallet in several versions.
Indicators of compromise
- Server:
mironanoru.zzz.com.ua. - A request to a Pastebin URL from a Rails process about 900 seconds after start in production.
rest-client (1.6.10)to(1.6.13)in aGemfile.lock.- Unexpected CPU use. The maintainers' notes say it reportedly mined cryptocurrency.
How to check
Find affected lock files.
grep --include='Gemfile.lock' -r . -e 'rest-client (1.6.1[0123])'
Check the installed gem.
gem list rest-client
What to do now
- Run
bundle update rest-clientto reach 1.6.14 or later. Check the lock file. - Check the other gems in the list above and remove them if you use them.
- If a bad version ran in production, treat the server as compromised. Rotate every secret in its environment variables.
- Block
mironanoru.zzz.com.ua.
Frequently asked questions
Which rest-client versions were backdoored?
Versions 1.6.10, 1.6.11, 1.6.12 and 1.6.13.
How do I find out if my app used one?
Search every Gemfile.lock for rest-client 1.6.10 through 1.6.13.
Sources
Send this page to the person who looks after AI at your company.