TL;DR
RubyGems.org fixed a critical CVSS 9.0 RubyGems.org RCE vulnerability on November 26, 2026. Any user with a push API key could spark unsafe RubyGems YAML deserialization before ownership checks ran. While the hosted site is safe now, self-hosted teams must update right away.
Why It Matters
Ruby teams worldwide pull billions of code gems from RubyGems.org each year. Because this bug let any user with a push key hit upload workers, a foe needed no gem ownership to strike. On Ruby 4.0.9, pairing this flaw with a regex compiler memory bug allowed remote code runs in the worker process.
Even on safe Ruby builds, bad patterns could crash or drain RAM on upload hosts. Notably, Ruby fixed seven regex and string memory bugs in Ruby 4.0.10, 3.4.13, and 3.3.14 on November 18, 2026. Per the RubyGems.org GitHub security advisory, staff checked live logs and 29,100 gems pushed from October 5 to November 4, 2026. That audit found no direct proof of live raids, though short log limits cannot rule out older tries. Likewise, no public exploit code exists yet, and no CVE ID is set.
How the Attack Works
Bypassing Schema Checks via Ignored Tags
This RubyGems.org RCE vulnerability (CWE-502) sits in the push check at POST /api/v1/gems. Normally, GemValidator::Package checks a gemspec’s YAML tree against a strict schema before making Ruby objects. However, GemValidator::NodeInfo::IGNORED_TAGS listed the !ruby/regexp tag.
Because the check ignored that tag, a text field like summary passed as plain text. Next, the host called gemspec_ast.to_ruby, making Psych build a live Regexp object and compile the pattern. Crucially, this ran before Pusher checked gem ownership. Thus, any user with a push key could reach the parser.
Triggering Memory Corruption on Ruby 4.0.9
In local tests on Ruby 4.0.9, staff linked that RubyGems YAML deserialization path to a regex compiler memory bug. Compiling the crafted pattern ran code as the upload worker. Staff tested this chain only on local hosts, not on the live site.
Affected Versions
- Hosted RubyGems.org: Previously affected and now patched on the live service.
- Self-Hosted RubyGems.org Registry: Deployments running commits prior to the GHSA-7h7w-m82c-x2xg fix.
- CVE Status: No CVE ID has been assigned yet; track via GHSA-7h7w-m82c-x2xg.
Patch and Mitigation Steps
Standard gem users and authors on RubyGems.org do not need to act. Staff already pushed the fix to the live site. First, they dropped !ruby/regexp from IGNORED_TAGS so bad tags return HTTP 422. Second, they swapped raw to_ruby calls for safe_to_ruby to block YAML aliases and limit classes.
In addition, staff capped OIDC::AccessPolicy match rules at 255 chars to stop CPU drain. If you host your own RubyGems.org copy, pull the latest fix commit now. Also, upgrade Ruby to 4.0.10, 3.4.13, or 3.3.14 to close this RubyGems.org RCE vulnerability.
Support Our Threat Intelligence
Find our vulnerability reports and weekly recaps helpful? Support our work today and unlock a 100% ad-free reading experience!