NEWS

Ruby Fixes 7 Regex and String Flaws, Warns 5 Have Proof-of-Concept RCE

Ruby 4.0.10, 3.4.13 and 3.3.14 fix seven memory-safety bugs in the regex engine and case conversion. Maintainers know of PoCs for remote code execution.

Dylan H.

News Desk

November 19, 2026
3 min read
Ruby Fixes 7 Regex and String Flaws, Warns 5 Have Proof-of-Concept RCE

What happened

The Ruby project announced on November 18 that it fixed seven memory-safety flaws in its regular expression engine and its string case-conversion code. The maintainers say: "We are aware of PoCs that prove some of them can be used to trigger remote code execution." The advisories report no attacks so far.

CVE IDs have not been assigned yet. The project has requested them, so the GitHub advisory IDs are the tracking identifiers for now.

The seven flaws

SeverityAdvisoryIssue
CriticalGHSA-34m4-m9fh-gqp5One-byte heap overflow when changing the case of a string in certain single-byte encodings (such as ISO-8859-1 and Windows-1252). RCE PoC exists.
CriticalGHSA-7x2q-68qv-6p8xDouble free when compiling a regex that uses character-class intersection (&&). RCE PoC exists.
CriticalGHSA-3p8q-wmhx-vm2wHeap overflow when the size of a compiled regex overflows during compilation. RCE PoC exists.
HighGHSA-87fm-7w84-j2pxHeap overflow when a case change produces a result larger than 4 GiB. A PoC exists, but the size needed makes it impractical for most requests.
HighGHSA-7whj-cfh7-xgm4Heap overflow when Regexp#to_s converts a crafted compiled regex back to text. RCE PoC exists.
HighGHSA-wpqw-5qxg-m68rOut-of-bounds read in case-insensitive matching. The PoC shows attacker-controlled memory corruption; RCE is considered possible but not shown.
ModerateGHSA-pvgc-g7gj-pv6hOut-of-bounds read matching a case-insensitive backreference against a crafted subject string. May leak memory or crash the process. No PoC published.

Affected and fixed versions

Ruby lineAffectedFixed in
4.04.0.0 to 4.0.94.0.10
3.43.4.0 to 3.4.123.4.13
3.33.3.13 and earlier3.3.14
3.2 and earlierEnd of lifeNo fix; move to a supported line

Ruby 3.3 moved from security maintenance to legacy maintenance with 3.3.14. Its support ends at the end of March 2027.

Who is exposed

  • Regex flaws: applications that build a regex from attacker-controlled input, then compile or run it. Matching untrusted text against a developer-written pattern is generally a different risk, except for the moderate backreference bug.
  • Case-conversion flaws: applications that change the case of crafted strings, especially imported or external text.
  1. Upgrade the Ruby interpreter on application servers, background workers and container images, then restart or rebuild them.
  2. Remember that updating gems or the framework does not replace a vulnerable interpreter.
  3. Move Ruby 3.2 and earlier to a supported release.
  4. Audit code that compiles regexes from user input, and avoid it where possible.

An October 23 release (Ruby 4.0.9, 3.4.12, 3.3.13) fixed separate regex compilation bugs found by GitLab. See our earlier coverage: Ruby Fixes Three Regex Engine Bugs.

Credit goes to Stephan Lipp (Ada Logics) and Anthropic for four findings, and to baba_yaga, aphantom, Hiroya Fujinami and Hiroshi SHIBATA for three.

Sources