339 points by runesoerensen 1 day ago | 131 comments | View on ycombinator
tptacek 1 day ago |
pentestercrab 1 day ago |
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 Railslousken 1 day ago |
nickcw 1 day ago |
It sounds like they are using GitHub to assign CVEs. We do the same at the rclone project. GitHub are running at a 4 week delay assigning CVEs! They used to do it in 2-3 days.
rvz 1 day ago |
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...
vintermann 1 day ago |
Just some days ago I ordered some sheet music, and guess what, it was shipped to an address where ÆØÅ were replaced with ? too. Hopefully it will arrive.
The amount of code out there that still simply breaks on non-ASCII characters (even Latin-1 characters!) is unbelievable. No wonder the AI vulnerability scanners are having a field day.
mpetrovich about 23 hours ago |
“I know, I’ll use regular expressions to solve it,” you think.
Now you have two problems.
xiaoliangliang 1 day ago |
slopinthebag 1 day ago |
TZubiri 1 day ago |
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.