Need help?
<- Back

Comments (44)

  • tptacek
    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 grooming for it must be really fussy! I couldn't find any other character pairs that expand like this.You can feed strings in 1252 to a Rails program through multipart POSTs, which get to pick their encodings.The great thing about this bug, apart from how it illustrates how doomed we all are (if I'm right), is that it should by rights have the best vulnerability name of the year, because you get to work 'ß' into it.
  • pentestercrab
    str = ("\x82\xA0" + ("A" * (2**32 + 4))).force_encoding(Encoding::Shift_JIS) puts "str.bytesize: #{str.bytesize}" puts "str.encoding: #{str.encoding}" puts "str.valid_encoding?: #{str.valid_encoding?}" new_str = str.downcase puts "new_str.bytesize: #{new_str.bytesize}" puts "new_str.bytes: #{new_str.bytes}" puts "new_str.encoding: #{new_str.encoding}" outputs on an unfixed version: str.bytesize: 4294967302 str.encoding: Shift_JIS str.valid_encoding?: true new_str.bytesize: 6 new_str.bytes: [130, 160, 97, 97, 97, 97] new_str.encoding: Shift_JIS also I'd suggest you check out CVE-2026-128084 (GHSA-4fqr-96q8-xrfx) if you are interested in C bugs impacting Ruby on Rails
  • lousken
    I need a vacation
  • rvz
    These are all C-based memory corruption vulnerabilities.The reality of these type of bugs being found by autonomous AI models on established software should tell you by now that memory-unsafe languages are completely exposed.This is who maintainers you are up against:"Thanks to Stephan Lipp (Ada Logics) and Anthropic for reporting this issue."Imagine attackers using abliterated models at scale who don't disclose these issues.[0] https://github.com/ruby/ruby/security/advisories/GHSA-34m4-m...
  • xiaoliangliang
    [dead]
  • slopinthebag
    oh boy. if only we had a language that could prevent this from happening. oh well, i guess there is nothing we can do but patch these things once they're discovered.
  • TZubiri
    It should be pretty straightforward to replace regexes with good ole ifs, array acceses, and comparision operators, whether manually or with an LLM. Pretty low hanging fruit to shave off some kilobytes of attack vector