RubyGems upload flaw could run code on registry servers
Original title: Critical RubyGems Vulnerability Could Let Attackers Execute Code on Package Registry Servers
Publishers need only an API key; a review of 29,100 gems found no direct exploitation evidence.
A GitHub advisory, GHSA-7h7w-m82c-x2xg, published November 26, 2026, rates a RubyGems.org package-upload flaw CVSS 4.0 9.0 and lists no CVE. The validator treated gemspec metadata as text while the YAML parser turned it into a regular expression before ownership was checked. Local testing on Ruby 4.0.9 combined that mismatch with a regex-compiler memory bug to run code as the upload worker. The live service showed no code execution, and 29,100 gems published October 5 through November 4, 2026, showed no direct exploitation. Hosted users need not act; self-hosted deployments must take the fixed code revision.
Unconfirmed: Earlier attempts cannot be excluded because logs were retained only briefly and upload contents were not logged.
- CWE-502, deserialization of untrusted data, is the cited weakness.
- An attacker did not need to own an existing gem name.
- Builds not open to code execution could still crash or run out of memory.
- The fix rejects regular expressions in text gemspec fields.
- This is a registry-side issue, not a malicious gem installed by developers.
Impact: Authenticated remote code execution on upload workers
| Product | Affected |
|---|---|
| RubyGems.org | — |
- 1.Teams running self-hosted RubyGems.org should update to a revision that contains the fix.
- Vendors
- RubyGems
- Products
- RubyGems.org
From the original article
2 min read at cybersecuritynews.com
RubyGems. org disclosed a critical package upload flaw that could let authenticated attackers execute code on registry servers by exploiting how gem metadata is processed. Maintainers demonstrated remote code execution in a local test using Ruby 4.
By Abinaya · cybersecuritynews.com
A short excerpt; the article and its images belong to the publisher. Summary, key facts and assessment above are AI-written from the article and can be wrong.