aws_sdk_wrapper (RubyGems): malicious gem steals AWS IAM credentials and DB env vars at install/require time
Severity: critical · Patch status: no-fix-needed · Since 2026-11-19
The RubyGems package awssdkwrapper v0.0.99, which mimics the AWS SDK namespace but ships no SDK functionality, was identified as malware by Amazon Inspector via the OpenSSF malicious-packages project and published to the GitHub Advisory Database on 2026-11-19. The gem exfiltrates credentials through two identical code paths: extconf.rb runs automatically during gem install via the gemspec extensions entry, and lib/runtimepayload.rb is loaded unconditionally on require. Both query EC2 IMDSv1/IMDSv2 at 169.254.169.254 for IAM role credentials, collect host fingerprints (hostname, whoami, uname, pwd, local IP), ECS task metadata, and environment variables matching DATABASE/MYSQL/POSTGRES/REDIS/RDS, then POST everything to a hardcoded webhook.site endpoint. A stub Makefile makes the build appear successful. There is no patched version; the gem has ~21 downloads/month.
What to do
- Remove aws_sdk_wrapper 0.0.99 from all Gemfiles, lockfiles, and dependency trees; do not install or require it
- Rotate all AWS IAM role credentials on any host where the gem was installed or required, and revoke active sessions
- Rotate database credentials found in DATABASE/MYSQL/POSTGRES/REDIS/RDS environment variables on affected hosts
- Audit CI/CD and build environments for the gem's presence and review egress logs for connections to webhook.site/4b2354a7-67fd-4641-92ac-e18bac8c09e8
- Check CloudTrail and ECS metadata access logs for anomalous IMDS queries and block IMDS access where not needed (enforce IMDSv2 with hop limit)
Sources
All live incidents on Threat Watch