CVE-2026-132825 (GHSA-34m4-m9fh-gqp5) is a one-byte heap-based buffer overflow (CWE-193, off-by-one) in Ruby's case conversion of strings in single-byte encodings. The fix commit is ruby/ruby d582f8f13d700d8e39714d3a8f11eb4bd2bc69f0, "Fix a heap buffer overflow in case mapping of the sharp s".\n\nRoot cause: Each affected encoding provides a case-mapping callback named case_map (invoked through the encoding's case_map function pointer by the String#upcase / String#downcase / String#swapcase / String#capitalize / casecmp? code paths). Inside that loop, when the input byte is the sharp s (0xDF), upcasing/case-folding writes TWO output bytes: it first emits 'S' (or 's' when folding) and then emits the second mapped byte ('S'/'s'). The loop guard, however, only ensured ONE byte of remaining room (to < to_end). Consequently, when the output buffer had exactly one free byte left, the second write landed one byte past the end of the heap buffer. The commit message states it explicitly: "The case_map functions of ISO-8859-x and Windows-125x map the sharp s (0xDF) to two bytes but checked for only one byte of room in the output buffer, so they wrote one byte past the buffer. Check for two bytes."\n\nThe patch changes the guard in all 14 affected encoders from while (*pp < end && to < to_end) to while (*pp < end && to_end - to > 1), guaranteeing two bytes of room. The encodings are ISO-8859-1, -2, -3, -4, -9, -10, -13, -14, -15, -16 and Windows-1250, -1252, -1254, -1257. These are exactly the single-byte encodings whose case_map performs the two-byte sharp-s expansion (the ASCII-only variants such as onigenc_single_byte_ascii_only_case_map do not expand 0xDF and were untouched).\n\nRuntime profile: Ruby is implemented in C, so a native profiler sampling during the exploit will attribute the overflowing store to the encoding-specific case_map function (a static symbol resolved as case_map), reached from the Ruby string case-conversion routines that call the encoding's case_map callback. Since C symbol names are not namespaced and the function is declared static int case_map(...) in each translation unit, the profiler entry is simply case_map (distinguished only by the source file that supplied it). The patch modifies the function that lacked the bounds check, so case_map is the vulnerable function, not any sanitizer introduced by the fix.