"no direct evidence of exploitation," the advisory says.
Registry metadata and the YAML !ruby/regexp bypass
RubyGems.org fixed a critical flaw in how it reads the YAML metadata carried inside gem uploads. The registry's metadata validator accepted fields tagged with the YAML !ruby/regexp marker as plain text, allowing any account holding a push-capable API key to supply an attacker-controlled regular-expression pattern in gem metadata. Ruby's YAML library, Psych, then turned that field into a real regular expression and compiled whatever pattern the attacker supplied — all before the registry checked whether the account actually owned the gem name.
Local exploit test and the Ruby regexp memory‑corruption link
In local testing, the registry maintainers chained this metadata-read flaw with a memory-corruption bug in Ruby's regexp compiler and achieved remote code execution, the advisory says. The test ran on Ruby 4.0.9 — a version affected by seven flaws in Ruby's regexp engine and string case conversion that the Ruby project patched on November 18. The advisory does not specify which memory-corruption bug the chain used.
The advisory notes that even on Ruby builds not vulnerable to code execution, compiling an attacker-supplied pattern can crash an upload worker or exhaust its memory. The code execution in the maintainers' test ran with the privileges of the gem-upload worker in a local environment; the advisory does not say whether an attacker who reached that point could have accessed published gems or publishing credentials.

This site is the portfolio.
OSINTSights runs on Cloudflare Workers, D1, R2, and Vectorize, with an AI pipeline on Hetzner ARM. Nubivance designed, built, and operates it. We do the same for clients.
See what we buildProduction review, logging gaps, and scale
RubyGems.org reviewed production telemetry and 29,100 gems published between October 5 and November 4 and found "no direct evidence of exploitation," the advisory reports. However, maintainers acknowledged gaps: logs were not kept long enough, and upload payloads were not recorded, so earlier attempts cannot be ruled out. The hosted registry itself contains roughly 199,000 gems and reports more than 278 billion downloads on its statistics page.
Fixes deployed on RubyGems.org and additional hardening
The registry's schema validation now rejects regexp-tagged gemspec fields with an HTTP 422 response. Gem metadata is also read with a restricted YAML loader that refuses YAML aliases and permits only the small set of classes a valid gemspec uses. As an extra safeguard, patterns used in OIDC access policies are capped at 255 characters before compilation. The validation change entered the registry's public code repository on November 4 (UTC), three weeks before the disclosure; the commit history shows the update.
What this means for gem users, self‑hosted operators, and Ruby application owners
- Gem users: The advisory is explicit — gem users on the hosted registry need to do nothing. The hosted RubyGems.org service is fixed.
- Operators who self-host the RubyGems.org software: Update to a commit containing the registry-side fix described in the advisory.
- Ruby application owners and runtime maintainers: The seven runtime flaws in Ruby's regexp engine and string case conversion are fixed in Ruby 4.0.10, 3.4.13 and 3.3.14, per the Ruby project's security announcement; applications should move to those patched Ruby releases.
The vulnerability is tracked as GHSA-7h7w-m82c-x2xg and carries a 9.0 score on the CVSS scale; no CVE has been assigned, the advisory says. The chain that yielded code execution in local testing demonstrates the practical risk of combining a validation bypass with a runtime memory-corruption flaw. At the same time, the registry's telemetry review found no direct evidence of exploitation in the defined window, and maintainers pushed a schema- and loader-based mitigation that reduces the attack surface for future uploads.
For readers who want the original advisory and technical details, see the report at The Hacker News: https://thehackernews.com/2026/11/critical-rubygems-flaw-could-have-let.html




