Malicious code in aws_sdk_wrapper (RubyGems)
MAL-2026-20210
Published · Modified
Dependency scanning
Check whether aws_sdk_wrapper is in your codebase
Corgea flags malicious and compromised dependencies with reachability analysis, so you fix the packages that actually run in your application instead of working through the whole lockfile.
Description
__
Source: amazon-inspector (d7d404dac5d62c717d33c80682fe93f240bb31f71d0886311752dfbfdb390abe)
The gem presents itself as an AWS SDK wrapper but ships no SDK functionality. Two code paths perform identical credential theft against the installer. First, ext/.../extconf.rb runs automatically during gem install via the gemspec extensions: entry: it queries the EC2 Instance Metadata Service (IMDSv2 and IMDSv1) at 169.254.169.254 to read the host's IAM role security credentials, collects host fingerprint data (hostname, whoami, uname, pwd, local IP), ECS task metadata, and every environment variable matching DATABASE/MYSQL/POSTGRES/REDIS/RDS, and POSTs the data to the hardcoded endpoint https://webhook.site/4b2354a7-67fd-4641-92ac-e18bac8c09e8. It then writes a stub Makefile so the build appears to succeed and no native source is actually compiled. Second, lib/runtime_payload.rb is loaded unconditionally from lib/aws_sdk_wrapper.rb, so require 'aws_sdk_wrapper' repeats the same IMDS credential read, host fingerprint, DB env scrape, and ECS metadata exfiltration to the same webhook.site URL in any consumer process. The gem name mimics the AWS SDK namespace; the package is a lure whose only behavior is credential exfiltration at install time and at require time.
References
Ready to move
Start Securing
Free, no credit card | First findings in minutes