Ruby 4.0.10
Ruby 4.0.10 was released on November 18, 2026. It is a security and stability patch for the 4.0 series: seven vulnerabilities in Regexp and String case conversion, a long list of memory-safety fixes in String, Regexp and IO, and JIT corrections. There are no new language features and no deprecations.
Security Fixes
The release closes seven vulnerabilities, published as a single advisory covering Regexp and String case conversion:
GHSA-34m4-m9fh-gqp5: heap buffer overflow in case conversion of strings.GHSA-87fm-7w84-j2px: integer overflow in case conversion of strings.GHSA-7x2q-68qv-6p8x: double free in regular expression compilation.GHSA-3p8q-wmhx-vm2w: heap buffer overflow in regular expression compilation.GHSA-wpqw-5qxg-m68r: out-of-bounds read in case-insensitive regular expression matching.GHSA-pvgc-g7gj-pv6h: out-of-bounds read in case-insensitive backreference matching.GHSA-7whj-cfh7-xgm4: heap buffer overflow inRegexp#to_s.
All seven are memory-safety defects in String case conversion and Regexp compilation. Those code paths run in nearly every Ruby application, so the patch matters beyond services that process hostile input. A crash or a corrupted heap reachable from upcase, a case-insensitive match or a dynamically built pattern is a real availability risk.
String and Encoding Fixes
This is the largest section of the changelog. The notable entries:
IO#writeof a shareable String from multiple Ractors caused a use-after-free (Bug #22382).String#initialize(encoding:)stored an inflated capacity and wrote past the malloc'd buffer on append (Bug #22423).- Use-after-free in String formatting with wide character encodings (Bug #22461).
- UTF-32 strings with a byte of 0x80 or higher in the most significant position were reported as valid (Bug #22495).
String#unpack("m")computed the buffer size with an overflowing multiplication (Bug #22518).- Chilled-string paths were hardened: out-of-bounds in
String#append_as_bytes, overlappingmemcpyin string concatenation, and a buffer overflow in the chilled string warning insideString#setbyte. String#ljust,rjustandcenternow use the result encoding for the terminator (PR #17260).
Regexp, Core Classes and JIT
- Onigmo moved toward 6.2.0, bringing fixes for an out-of-bounds read in
parse_char_class(), a SEGV inonig_error_code_to_str(), and a stack overflow on long repetition patterns. - The number of captures could change depending on the encoding of the target string (Bug #22491).
String#rindexmissed a match with a leading.*in multiline mode (Bug #22492). - Out-of-bounds access in
Array#samplewhen the array is modified during the call (Bug #22449), and inTime#strftime(Bug #22458). --enable=zjitdid not enable ZJIT (Bug #22427). YJIT gained a frozen guard for struct attribute assignment and now falls back for explicit keywords in IFUNC block calls.- The default gem
jsonmoved from 2.18.0 to 2.18.3, which carries the fix for CVE-2026-33210.
One Behaviour Change to Check
Most of this release is invisible, but one fix changes observable behaviour. Array#find and Array#rfind had different arity in Ruby 3 and Ruby 4 (Bug #22470), and 4.0.10 settles on the Ruby 4 behaviour. If your code passes arguments to either method, or inspects method(:find).arity, verify it before deploying.
Upgrading
This is a drop-in patch for 4.0.x. With rbenv, run rbenv install 4.0.10 and then rbenv global 4.0.10, or rbenv local 4.0.10 per project. If ruby-build comes from Homebrew, update its definitions first, otherwise the new version may not be listed. asdf and mise users can add ruby 4.0.10 directly.
The same advisory covers the older maintained series; the patched releases for those lines are listed on the ruby-lang.org security page. The full commit list is in the repository's v4.0.9...v4.0.10 compare view.