# RubyGems.org fixes critical gem-upload flaw that let publishers submit malicious patterns

Maintainers used the flaw and a separate Ruby bug to run code in a local test. Gem users need no action, but operators who host the registry software themselves should update.

Published 30 November 2026 · Verified as of 30 November 2026 · AveNews · Software

https://www.avenews.am/en/posts/rubygems-registry-critical-code-execution-flaw · [Հայերեն](https://www.avenews.am/hy/posts/rubygems-registry-critical-code-execution-flaw)

> **Summary:** RubyGems.org has fixed an upload flaw that its maintainers used to execute code in a local test. Their review found no direct evidence of exploitation, and self-hosted deployments still need the fix.

RubyGems.org, the central registry for Ruby software packages known as gems, has fixed a critical upload flaw that let an authenticated publisher submit a malicious pattern for processing. An account needed an API key with permission to upload, but did not need to own a gem.[^1][^2]

The maintainers said they combined the flaw with a separate memory-corruption bug in Ruby’s regular-expression compiler to execute code locally on Ruby 4.0.9. The code ran with the permissions of the process handling gem uploads; the test did not use the live registry.[^2]

The flaw, identified as GHSA-7h7w-m82c-x2xg, has a severity score of 9 out of 10. The registry’s validation change entered its public code repository on 4 November, before the maintainers disclosed the issue last week, [The Hacker News](https://thehackernews.com/2026/11/critical-rubygems-flaw-could-have-let.html) said.[^1]

## How the upload flaw worked

The upload checker ignored a tag in a gem’s metadata, allowing Ruby’s software for reading that metadata to compile a supplied regular expression—a pattern used to match text. This happened before the registry checked ownership of the gem’s name.[^2]

The maintainers’ review of production records and 29,100 gems published from 5 October to 4 November 2026, found no direct evidence of exploitation. Records were kept for a limited time and the contents of uploads were not logged, so earlier attempts cannot be ruled out. The advisory does not say whether an attacker who executed code could have reached published gems or publishing credentials.[^2][^1]

## Who needs to update

The hosted registry now rejects metadata carrying the problematic tag before deserialization and uses a restricted reader that refuses YAML aliases and allows only the types of data needed for valid gem specifications. Gem users need do nothing for this registry flaw. Operators running their own RubyGems.org deployment should update to a code revision containing the fix.[^2]

Ruby2Shell is a separate flaw in the Ruby runtime, involving the conversion of text between upper and lower case. Ruby released patches for seven runtime vulnerabilities on 18 November. The Ruby project recommends upgrading affected applications to Ruby 4.0.10, 3.4.13 or 3.3.14; Ruby 3.2 and earlier are out of support and will not receive those fixes.[^3][^4]

## References

- [RubyGems.org](https://www.avenews.am/en/references/rubygems-org-q135964345): The Ruby gem registry whose maintainers fixed an upload flaw and reviewed possible exploitation.
- [Ruby](https://www.avenews.am/en/references/ruby-q161053): The programming language whose runtime had a separate set of vulnerabilities and received security patches.

## Sources

[^1]: [Critical RubyGems Flaw Could Have Let Any Gem Publisher Run Code on the Registry](https://thehackernews.com/2026/11/critical-rubygems-flaw-could-have-let.html), The Hacker News, 30 November 2026
[^2]: [Authenticated remote code execution in RubyGems.org gem pushes via !ruby/regexp gemspec tags · Advisory · rubygems/rubygems.org · GitHub](https://github.com/rubygems/rubygems.org/security/advisories/GHSA-7h7w-m82c-x2xg), github.com
[^3]: [Advisory: Ruby2Shell and Associated Vulnerabilities – Render Docs](https://render.com/docs/advisory-ruby2shell), render.com
[^4]: [Security advisories: multiple vulnerabilities in Regexp and String case conversion \| Ruby](https://ruby-lang.org/en/news/2026/11/18/multiple-vulnerabilities-in-regexp-and-string), ruby-lang.org
