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.
Maybe parent commenter was mixing up ß with þ; thorn.
> Þ (minuscule: þ), called thorn or þorn (/θɔːrn/ thorn), is a Latin-script letter used in the Old English, Old Norse, Old Swedish and modern Icelandic alphabets, as well as modern transliterations of the Gothic alphabet, Middle Scots, and some dialects of Middle English. It was also used in medieval Scandinavia but, except in Iceland (where it still survives), it was later replaced with the digraph th. The letter originated from the rune ᚦ (Thurisaz) in the Elder Futhark and was called thorn in the Anglo-Saxon and thorn or thurs in the Scandinavian rune poems. It is similar in appearance to the archaic Greek letter sho (ϸ), although the two are historically unrelated. The only language in which þ is currently in use is Icelandic.
Both fixable, but as with a lot of Unicode stuff, might take a long while
Interestingly Unicode included the uppercase ß since 2008.
tbh I'm German and just learned about this now. I don't even know which keyboard incantation I would have to use to create this abomination. My android keyboard does not seem to have an uppercase ß.
It's a little amusing how many Germans I've heard this from, meanwhile as a non-German I think I first heard about ß and ẞ at least a decade ago.
Maybe this is one of those "outsiders have fresh eyes" things where googling "wait, wtf is up with ß" is not something most Germans would do?
A similar thing happens with Japanese natives and ヷ/わ゛ -- most are not aware this character existed historically and they usually also incorrectly guess how it's read.
https://devblogs.microsoft.com/oldnewthing/20200804-00/?p=10...
https://devblogs.microsoft.com/oldnewthing/20241007-00/?p=11...
Python has good string support, as does Rust. I think (though I don't know it myself) Perl is famous for good string handling? Even bash has ok support for working with strings.
So I don't really agree on "aren't many languages", but then again there are a ton of languages I don't know, so maybe those I mentioned are the exception.
[1] or according to some a rotten compromise, between those who though UTF-32 wastes memory and UTF-8 discriminates non-latin languages.
And to be clear, UTF-16 was not chosen anywhere for that reason. It only exists because people thought UCS-2 would be enough for everybody (even though that was always far-fetched and futilely trying to make it reality has permanently damaged Unicode) and UTF-16 was the easies quck fix hack to "fix" UCS-2 based systems. It's yet another short term solution that will keep causing problems forever.