Multiple vulnerabilities in Regexp and String case conversion
92 points by runesoerensen 3 hours ago | 19 comments

tptacek 2 hours ago
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.

reply
testplzignore 50 minutes ago
I wonder if there is a similar bug for U+0130 which (I think) expands to two characters when lowercased.
reply
tptacek 48 minutes ago
Maybe somewhere! But that character isn't in Windows-1252 at all, so it can't trip this string counting bug.
reply
bee_rider 34 minutes ago
Haha, that exact character caused problems in a programming class I tutored for. Got to throw the first year students some curveballs.
reply
xp84 59 minutes ago
Should we call it #upcaße2Shell?
reply
tptacek 55 minutes ago
One of the discoverers suggested, on Twitter, Ruby2ßhell. My wife, who speaks and writes German, refused to entertain this.
reply
cowlevel 2 hours ago
Unicode also has this feature because SS is the correct uppercase form of ß
reply
p-e-w 7 minutes ago
It’s not. There are multiple uppercase forms, including “SS”, “SZ”, and the uppercase ß character, all of which are well-established, which makes all of them correct according to the principle of linguistic descriptivism.
reply
frangonf 5 minutes ago
Or so the Germans would have us believe...
reply
lousken 2 hours ago
I need a vacation
reply
donkey_brains 2 hours ago
We all do, but we don’t know if our companies will still be there when we get back.
reply
cwmoore 2 hours ago
I hear Java is nice
reply
layer8 2 hours ago
You can find nice shells on the beaches.
reply
NooneAtAll5 2 hours ago
java had vulnerability in base64 decode asm

https://calif.io/java4shell/

reply
saghm 16 minutes ago
A full day ago! Practically ancient
reply
_pdp_ 2 hours ago
Book it for 18 months from now. Oh, also bring your laptop.
reply
TZubiri 2 hours ago
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
reply
preinheimer 45 minutes ago
I think you’re underestimating the complexity of a lot of regular expressions.
reply
marcus_holmes 41 minutes ago
Also that a lot of the regexes will be inside Rails code that we can't touch, Gems that need maintaining, etc.
reply