Skip to content
NewA calmer, faster ZeroHour

RubyGems.org fixes critical metadata flaw that could run registry code

Original title: Critical RubyGems Flaw Could Have Let Any Gem Publisher Run Code on the Registry

The Hacker News ()2 min read
Part of a story covered by 3 sourcesRubyGems.org patches critical upload flaw; no live exploitation foundMerged summary & timeline
AI summary · x-ai/grok-4.7Summaries by Vani AI

Any push-capable API key could inject a regexp via YAML; maintainers reached code execution locally, with no CVE assigned.

RubyGems.org fixed GHSA-7h7w-m82c-x2xg, a CVSS 9.0 flaw with no CVE, in how gem upload metadata is read as YAML. A push-capable API key could pass a !ruby/regexp tag that Psych compiled before ownership checks. Maintainers chained it in local testing on Ruby 4.0.9 with a regexp memory-corruption bug and reached code execution as the upload worker. A review of 29,100 gems published from October 5 to November 4 found no direct evidence of exploitation.

Unconfirmed: The advisory found no direct evidence of exploitation but said incomplete logs cannot rule out earlier attempts, and it does not say whether code execution could reach published gems or credentials.

Key facts
  • Schema validation now rejects regexp-tagged gemspec fields with an HTTP 422 error.
  • Self-hosters should update to a commit that contains the registry fix.
  • Related Ruby regexp flaws are fixed in 4.0.10, 3.4.13 and 3.3.14.
  • Logs were not kept long enough to rule out earlier upload attempts.
  • Users of the hosted registry do not need to take action.
Security assessment · AI, from the articleNo known exploitation

Impact: Remote code execution as the gem-upload worker

ProductAffectedFixed in
RubyGems.org—a commit containing the fix
Ruby4.0.9 used in the maintainers' test4.0.10, 3.4.13, 3.3.14
What to do
  1. 1.Gem users of the hosted registry do not need to act.
  2. 2.Self-hosters should update to a commit containing the registry fix.
  3. 3.Update Ruby applications to 4.0.10, 3.4.13 or 3.3.14.
Analyze this story with Vani AIImpact, who is affected and what defenders should do, in a new chat

From the original article

2 min read at thehackernews.com

RubyGems. org, the central registry for the Ruby community's gems, has fixed a critical flaw that let any account with a push-capable API key feed an attacker-controlled regular expression into the metadata of a gem upload. In local testing, the registry's maintainers chained the flaw with a memory corruption bug in Ruby's regexp compiler and reached remote code execution, they said in an

The Hacker News

thehackernews.com

Read the full article at The Hacker News

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.