Malicious package substitution via premature S3 write
Published May 12, 2022 · Updated Apr 22, 2025
Authorization failure in RubyGems.org allows remote authenticated users to substitute malicious files for platform-specific gems. The upload path wrote a crafted invalid gem to S3 before its database transaction completed, leaving no matching record while a primed Fastly cache retained the file. Exploitation requires an account, a guessed next version, a numeric platform suffix, and cache priming; downloads can receive attacker-controlled gem code.
Summary
What happened
Authorization failure in RubyGems.org allows remote authenticated users to substitute malicious files for platform-specific gems. The upload path wrote a crafted invalid gem to S3 before its database transaction completed, leaving no matching record while a primed Fastly cache retained the file. Exploitation requires an account, a guessed next version, a numeric platform suffix, and cache priming; downloads can receive attacker-controlled gem code.
The record
- CVE
- CVE-2022-29218
- Published
- May 12, 2022
- Updated
- Apr 22, 2025
- Vendor
- RubyGems
- Product
- RubyGems.org
- Classifications
- CWE-863, CWE-269, CWE-290, T1195.002
- Attack vector
- network
- Privileges
- authenticated
Timeline
How it unfolded
- May 12, 2022CVE publishedPublication date reported by the CVE source.
- Apr 22, 2025Record updatedLatest update available in the CVE record.
Exploitability
Present is not the same as exploitable
Compare your product and version with the public record. A matching version still requires validation against your environment.
Is a vulnerable build present?
Compare these published version ranges with your installed build and any vendor patches.
- Affected versionversion=n/a
What conditions does exploitation require?
What is affected?
Published CVSS scores
CVSS describes severity. EPSS estimates exploitation probability.
Attacks
What attackers are doing with it
Daily unique IPs observed by Shadowserver honeypots for known exploited vulnerabilities (KEVs). Missing observations do not establish an absence of attacks.
Weakness, pattern, technique
Public exploit references
- RubyGems.org crafted-gemspec exploit procedureproof of concept · demonstrated
Labels summarize the accepted research assessment. They do not indicate a test against your environment.
Technologies
Your stack
See the directory against your own environment.
Your stack
Check the software in your environment
Book a demo to see how Hinoki identifies affected software and validates exploitability in your environment.
Book a demo