Ruby patches seven flaws; five have code execution PoCs

Ruby patches seven flaws; five have code execution PoCs

Add CyberWorldOpsto your preferred sources on Google
Ruby patches seven flaws; five have code execution PoCs
Vulnerabilities

Illustrative image generated with AI

Ruby has released fixes for seven memory-safety vulnerabilities that could let crafted strings or regular expressions compromise applications. The maintainers’ security advisories, published November 19, say proof-of-concept exploits demonstrate remote code execution—running an attacker’s code on the machine—for five flaws in some scenarios; the fixes are Ruby 4.0.10, 3.4.13 and 3.3.14.

Applications running affected Ruby versions contain the vulnerable code, but an attacker’s ability to reach it depends on how each application handles outside input. Applications that compile user-controlled regular expressions or change the case of untrusted strings need particular attention. The Hacker News reported that the fixed releases shipped November 18 and that the advisories reported no attacks so far.

Where crafted input can reach the flaws

Five vulnerabilities affect Ruby’s regular expression engine, which processes patterns used to search or match text. Most require the application to build a pattern from attacker-controlled input and then compile, match or otherwise process it. Matching outside text against a developer-written pattern generally does not create the same exposure, with one specific exception involving a case-insensitive backreference.

The other two vulnerabilities affect string case conversion independently of regular expressions. For example, an application that changes imported text from lowercase to uppercase could reach vulnerable code if the string meets the flaw’s conditions.

The maintainers rate three flaws critical, three high and one moderate:

  • Critical: GHSA-34m4-m9fh-gqp5. Case conversion in certain single-byte encodings, including ISO-8859-1 and Windows-1252, can write one byte beyond the allocated output buffer. This heap buffer overflow—a write outside a reserved memory area—has a proof of concept demonstrating remote code execution in some scenarios.
  • Critical: GHSA-7x2q-68qv-6p8x. Compiling a crafted pattern containing a character-class intersection (&&), which combines character sets, can make Ruby release the same memory buffer twice. This “double free” has a remote-code-execution proof of concept and affects applications compiling attacker-controlled patterns.
  • Critical: GHSA-3p8q-wmhx-vm2w. The calculated size of a compiled regular expression can exceed its numeric storage limit, causing an integer overflow and a write beyond a heap buffer. Crafted attacker-controlled patterns have demonstrated remote code execution in some scenarios.
  • High: GHSA-87fm-7w84-j2px. Case conversion whose output exceeds 4 GiB can overflow the result-length calculation and write beyond a heap buffer. A remote-code-execution proof of concept exists, although The Hacker News noted that the required size puts it beyond most requests.
  • High: GHSA-7whj-cfh7-xgm4. Converting a crafted compiled regular expression into text through Regexp#to_s can write beyond a heap buffer. The advisory describes possible information disclosure or remote code execution in applications compiling attacker-controlled patterns, with code execution demonstrated in some scenarios.
  • High: GHSA-wpqw-5qxg-m68r. Case-insensitive matching with an attacker-controlled pattern can read outside an intended memory area and lead to memory corruption. The maintainers say proof-of-concept exploits demonstrate attacker-controlled corruption; remote code execution remains a possible outcome rather than a demonstrated one.
  • Moderate: GHSA-pvgc-g7gj-pv6h. Matching a crafted subject string against a pattern containing a case-insensitive backreference—a reference to previously matched text—can read outside the intended memory area, potentially exposing memory contents or crashing the process, The Hacker News reported. This is the exception that can affect applications using a fixed developer-written pattern.

The project credits Stephan Lipp of Ada Logics and Anthropic with four findings. It credits aphantom with the critical compilation-size overflow, baba__yaga with the case-conversion overflow involving output larger than 4 GiB, and Hiroya Fujinami and Hiroshi SHIBATA among the reporters of the remaining flaw. The announcement and advisories do not include the proof-of-concept code, The Hacker News reported.

These fixes follow separate October 23 releases—Ruby 4.0.9, 3.4.12 and 3.3.13—for compilation bugs found by GitLab that underlay four critical GitLab flaws; The Hacker News reported that one drew an attempted attack against Alpine Linux’s GitLab server and was subsequently added to CISA’s Known Exploited Vulnerabilities catalog.

Update the Ruby interpreter

The issuer advisories list these affected ranges and replacements:

  • Ruby 4.0.0 through 4.0.9: upgrade to 4.0.10.
  • Ruby 3.4.0 through 3.4.12: upgrade to 3.4.13.
  • Ruby 3.3.13 and earlier: 3.3.14 is the patched release in the 3.3 line.

Ruby 3.2 and earlier are end of life and will not receive these fixes, The Hacker News reported, citing the project’s recommendation to move to a supported line. With 3.3.14, the maintainers renamed the 3.3 support phase from security maintenance to legacy maintenance; support still ends at the end of March 2027.

CVE identifiers have been requested but remain pending, leaving the GitHub advisory identifiers as the available tracking references for scanners and software inventories.

Administrators should update the Ruby interpreter running application servers, background workers and container images, then restart the affected processes or rebuild the images. Updating gems or an application framework alone does not replace the vulnerable Ruby runtime.

Read next

Sources

Back to home

Latest Cybersecurity News

All cybersecurity news →