SAASMENT

News

Ruby patched seven memory bugs in regex and string case changes.

Ruby 4.0.10, 3.4.13, and 3.3.14 fix seven memory-safety bugs in the regex engine and in string case conversion. Maintainers say five have proofs of concept that run code, and they have not reported attacks.

Illustration of a lime bead chain cracking open a charcoal server block

Impact

What was impacted
Ruby’s own regular-expression compiler and string case-conversion code. Seven flaws: three critical, three high, and one moderate. No CVE numbers yet; the project has requested them, so track the GitHub advisory IDs. Affected ranges: 4.0.0 through 4.0.9 (fixed in 4.0.10), 3.4.0 through 3.4.12 (fixed in 3.4.13), and 3.3.13 and earlier (fixed in 3.3.14). Ruby 3.2 and earlier are end of life and will not be fixed.
Who was impacted
Operators of those interpreters on application servers, background workers, and container images. Regex bugs matter when an application builds a regular expression from attacker-controlled input and then compiles or runs it. Matching untrusted text against a pattern the developers wrote is a different case, except for the moderate read. Two of the bugs are not regex bugs: they fire when the application changes the case of a crafted string.
What you need to do
Install Ruby 4.0.10, 3.4.13, or 3.3.14 and restart or rebuild the processes that run it. Updating gems or the framework does not replace the interpreter. Move 3.2 and earlier onto a supported line. Until CVEs exist, match scanners to the GHSA IDs below. The advisories report no attacks on these seven.

Ruby shipped 4.0.10, 3.4.13, and 3.3.14 for seven memory-safety bugs in its regex engine and in the code that changes the case of a string. The project rates three critical, three high, and one moderate. Maintainers said they know of proofs of concept showing that some of the bugs can be used for remote code execution. For five of the seven, those proofs of concept have shown that crafted input can run code. The advisories report no attacks so far. CVE numbers have been requested and are not assigned yet, so the GitHub advisory IDs are the tracking keys. The announcement does not include the proof-of-concept code.

The three critical issues each have a remote-code-execution proof of concept, according to the advisories. GHSA-34m4-m9fh-gqp5 is a one-byte heap overflow when Ruby changes the case of a string in certain single-byte encodings, such as ISO-8859-1 or Windows-1252. GHSA-7x2q-68qv-6p8x is a double free while compiling a crafted regular expression that uses a character-class intersection (&&). GHSA-3p8q-wmhx-vm2w is a heap overflow when the size of a compiled regular expression overflows during compilation.

The high issues are GHSA-87fm-7w84-j2px, a heap overflow when a case change produces a result larger than 4 GiB (a remote-code-execution proof of concept exists, but the size puts it out of reach for most requests); GHSA-7whj-cfh7-xgm4, a heap overflow when Ruby turns a crafted compiled regular expression back into text with Regexp#to_s, also with a remote-code-execution proof of concept; and GHSA-wpqw-5qxg-m68r, an out-of-bounds read during case-insensitive matching. For that last one, the proof of concept shows attacker-controlled memory corruption, and the maintainers say remote code execution is possible but has not been shown. The moderate issue, GHSA-pvgc-g7gj-pv6h, is an out-of-bounds read when a case-insensitive backreference is matched against a crafted subject string. The advisory says it may disclose memory contents or crash the process.

Whether an attacker can reach a bug depends on the application. The regex flaws need code that builds a regular expression from input an attacker controls and then compiles or runs it. Matching untrusted text against a pattern the developers wrote does not pose the same risk, except for the moderate read, which can fire on a fixed pattern that uses a case-insensitive backreference. The two case-conversion flaws do not use regular expressions. They fire when the application changes the case of a crafted string, including imported or outside text. Stephan Lipp of Ada Logics and Anthropic is credited with four findings. baba__yaga, aphantom, Hiroya Fujinami, and Hiroshi SHIBATA are credited with the other three.

Install 4.0.10, 3.4.13, or 3.3.14 on the interpreter that actually runs the app, then restart workers or rebuild images. A gem or framework bump does not replace a vulnerable Ruby. Ruby 3.2 and earlier will not get a fix; move those hosts to a supported line. With 3.3.14, the project renamed the 3.3 phase from security maintenance to legacy maintenance. Support for 3.3 still ends at the end of March 2027. This is the second regex-engine patch set in a month. On 23 October the project shipped 4.0.9, 3.4.12, and 3.3.13 for compilation bugs GitLab found, which sat behind four critical GitLab flaws. One of those drew an attempted attack on Alpine Linux’s GitLab server, and CISA later listed it as exploited. Those October bugs are different from this week’s seven, and the new advisories do not say that GitLab or any other named product can be attacked through them.

For your AI agent

Agent instructions — copy paste to Claude

You are helping me respond to seven memory-safety flaws in Ruby's regular-expression engine and string case-conversion code. Fixed releases are Ruby 4.0.10, 3.4.13, and 3.3.14. The project rates three critical, three high, and one moderate. Maintainers said they know of proofs of concept that can trigger remote code execution for some of them. For five of the seven, those proofs of concept have shown that crafted input can run code. The advisories report no attacks so far. CVE numbers have been requested and are not assigned yet. Track the GitHub advisory IDs. Do not download or run any proof of concept.

Critical, each with a remote-code-execution proof of concept according to the advisories:
- GHSA-34m4-m9fh-gqp5: one-byte heap overflow when Ruby changes the case of a string in certain single-byte encodings, such as ISO-8859-1 or Windows-1252.
- GHSA-7x2q-68qv-6p8x: double free when compiling a crafted regular expression that uses a character-class intersection (&&).
- GHSA-3p8q-wmhx-vm2w: heap overflow when the size of a compiled regular expression overflows during compilation.

High:
- GHSA-87fm-7w84-j2px: heap overflow when a case change produces a result larger than 4 GiB. A remote-code-execution proof of concept exists; the size puts it out of reach for most requests.
- GHSA-7whj-cfh7-xgm4: heap overflow when Ruby turns a crafted compiled regular expression back into text with Regexp#to_s. Remote-code-execution proof of concept.
- GHSA-wpqw-5qxg-m68r: out-of-bounds read during case-insensitive matching. The proof of concept shows attacker-controlled memory corruption. Maintainers say remote code execution is possible but has not been shown.

Moderate:
- GHSA-pvgc-g7gj-pv6h: out-of-bounds read when a case-insensitive backreference is matched against a crafted subject string. The advisory says it may disclose memory contents or crash the process.

Affected ranges:
- Ruby 4.0.0 through 4.0.9, fixed in 4.0.10.
- Ruby 3.4.0 through 3.4.12, fixed in 3.4.13.
- Ruby 3.3.13 and earlier, fixed in 3.3.14.
- Ruby 3.2 and earlier: end of life, no fix. Move to a supported line.
With 3.3.14, the 3.3 phase was renamed from security maintenance to legacy maintenance. Support still ends at the end of March 2027.

Reachability:
- Regex flaws need an application that builds a regular expression from attacker-controlled input and then compiles or runs it. Matching untrusted text against a pattern the developers wrote is not the same risk, except for GHSA-pvgc-g7gj-pv6h, which can fire on a fixed pattern that uses a case-insensitive backreference.
- The case-conversion flaws (GHSA-34m4-m9fh-gqp5 and GHSA-87fm-7w84-j2px) do not use regular expressions. They fire when the application changes the case of a crafted string.

These seven are different from the 23 October 2026 regex compilation fixes in Ruby 4.0.9, 3.4.12, and 3.3.13, which were tied to bugs GitLab found. One of those October GitLab flaws drew an attempted attack on Alpine Linux's GitLab server and was later listed by CISA as exploited. The new advisories do not say GitLab or any other named product can be attacked through this week's seven.

Context:
- What was impacted: the Ruby interpreter's regex compiler and string case conversion, on the version ranges above.
- Who should care: operators of application servers, background workers, and container images running those versions.
- What to do: upgrade the interpreter and restart or rebuild. A gem or framework update does not replace Ruby.

Do this in order. Ask before editing deploy configs, Dockerfiles, or restarting workers. Prefer read-only inventory first. Do not write or run an exploit, a proof of concept, or a crafted pattern meant to trigger these bugs.

1. Inventory
   - Record the Ruby version on application servers, background workers, and container images (ruby -v, image tags, and the runtime the process actually uses).
   - Flag 4.0.0-4.0.9, 3.4.0-3.4.12, 3.3.13 and earlier, and any 3.2 or older.
   - Search application code for regular expressions built from request, import, or other outside input, and for case conversion on outside strings. Note fixed patterns that use a case-insensitive backreference.
   - Do not invent CVE numbers. If a scanner only matches CVEs, say these flaws are tracked as the GHSA IDs above until CVEs are assigned.
2. Contain
   - If you cannot upgrade today, propose limiting who can supply patterns that the app compiles, and review case conversion on untrusted strings. Ask before changing code or config. No vendor workaround is listed that replaces the upgrade.
3. Remediate
   - Plan upgrades to 4.0.10, 3.4.13, or 3.3.14, including image rebuilds. For 3.2 and earlier, plan a move to a supported line. Ask before restarting processes.
4. Verify
   - Confirm the running interpreter, not only a Gemfile, is the fixed build, and that old workers are gone.
5. Report back
   - Versions found, where untrusted patterns or case conversion showed up, what was upgraded, and anything still on an unfixed or end-of-life interpreter.

Do not invent CVEs, package versions, or exploit conditions. If a check needs access I have not given you, say what you need and stop.

← All news

Try the platform.

Open the demo workspace with mock data. No login. Register from the banner when you want early access. No security team. No call.

Try the platform