Multiple vulnerabilities in Regexp and String case conversion
Ruby released versions 4.0.10, 3.4.13, and 3.3.14 to patch seven critical memory safety vulnerabilities in its regex engine and string case conversion routines.
summary is enough The advisory lists critical CVEs that require immediate patching, while the discussion highlights AI-driven vulnerability discovery and memory safety in C.
summary
Ruby has patched seven memory corruption vulnerabilities across versions 3.3, 3.4, and 4.0, affecting string case conversion and the regular expression engine. Several flaws, including heap buffer overflows and double frees, can potentially lead to remote code execution when processing crafted inputs or attacker-controlled patterns. Researchers note that AI models like Anthropic's are accelerating the discovery of these C-based memory bugs. Users are strongly urged to upgrade immediately.
key points
- Seven vulnerabilities involving heap buffer overflows, integer overflows, and double frees were discovered in string case conversion and the regex engine.
- Several flaws can be triggered via crafted strings or regular expression patterns to achieve remote code execution.
- Fixes are available in Ruby versions 4.0.10, 3.4.13, and 3.3.14; older versions like 3.2 are end-of-life and will not be patched.
- Commenters note that automated AI models are increasingly used to discover these legacy C codebase issues.
who should read it
Ruby developers, system administrators, and security engineers maintaining applications running vulnerable Ruby versions.
discussion skeptical
consensus
Commenters are largely unsurprised by memory corruption bugs in C-based runtimes, with many pointing out that AI-assisted vulnerability discovery is uncovering flaws at scale and reigniting debates around memory safety.
pushback
Some push back on the inevitability narrative, arguing that porting massive C projects to Rust is practically infeasible and that C remains ubiquitous due to performance and tooling.
There's what I think is probably an awesome bug here.
Windows-1252 encoding has a representation for lowercase German sharp 's' (ß), but not one for the uppercase. If you upcase a string containing a sharp 's', it gets normalized to "SS", which increases the length of the string by one character. The 1252 case conversion code doesn't handle this; it looks like it checks for headroom in the buffer one character at a time. So if the last character of a string you upcase is ß, it looks like you get a one-byte overflow (of 'S').
If that's really the bug (there's a claimed RCE POC), the heap …
Explains the mechanics of a likely buffer overflow bug involving the German sharp 's' character expansion during case conversion in Windows-1252 encoding.
Generated by an LLM from the article and thread. Check the sources before relying on it.