
Critical RubyGems.org Flaw Allowed Attacker-Controlled Regex in Gem Metadata Leading to Potential RCE
RubyGems.org has patched a critical vulnerability that permitted any account holding a push-capable API key to inject an attacker-controlled regular expression into gem metadata during upload. The registry's maintainers demonstrated remote code execution by chaining the flaw with a memory corruption issue in Ruby's regexp compiler during local testing. The issue stemmed from the YAML metadata validator ignoring the !ruby/regexp tag, allowing Psych to deserialize and compile arbitrary patterns before ownership checks occurred. No evidence of exploitation was found in a review of 29,100 gems published between October 5 and November 4, though logging limitations prevent ruling out earlier attempts. The flaw, tracked as GHSA-7h7w-m82c-x2xg with a CVSS score of 9.0, has been mitigated through stricter schema validation and a restricted YAML loader. Self-hosted operators must update their instances, while Ruby users should apply patches in versions 4.0.10, 3.4.13, and 3.3.14 to address related runtime issues.
The Hacker NewsNov 30, 2026Translated from English