So the recent RCE wave seems to be people finding more single byte overflows and such, but reporting them as RCEs because AI can do the tedious grunt work of finding the rest of the vulnerability chain.
If any single byte overflow can be converted into an RCE with minimal human effort then we have no choice but to prove the whole software stack is memory safe.
Thought this was another vulnerability for a second, but for anyone else who thought the same, this is already covered in the Ruby advisory being discussed here https://news.ycombinator.com/item?id=50554038 (which covers six other vulnerabilities).
There should be other codepoints other than ß that in principle could be used for a vulnerability like that. There are even ones that expand to three codepoints, like ffi.
Can you elaborate on what makes ß special enough to enable the vulnerability.
A quick search showed that there are other cases in legacy encodings that expand to multiple bytes.
For example 0xEF in ISO 6937 expands to CA BC 4E in UTF-8 after case transformation. Similar to ß this is a case with a single byte legacy encoding with a single lowercase unicode codepoint which has no precomposed upper case equivalent.
I suppose this function has been written first in assumption, that case conversion doesn't affect length, but later ß -> SS conversion has been added without proper testing.
There was never any guarantee that case conversion is byte length equivalent. Except for pure ASCII, that's just been an incorrect assumption from the start.
Ah, so that's the real reason "ß" is now allowed in uppercase too (https://en.wikipedia.org/wiki/%C3%9F)? Reducing the risk of security issues by removing an edge case?
It even seems the "more correct" uppercase form of ß is now ẞ, not SS.
> Traditionally, ⟨ß⟩ did not have a capital form, and was capitalized as ⟨SS⟩. Some type designers introduced capitalized variants. In 2017, the Council for German Orthography officially adopted a capital form ⟨ẞ⟩ as an acceptable variant, ending a long debate.[4] Since 2024 the capital has been preferred over ⟨SS⟩.[5]
You can freely specify the encoding when sending multipart/form-data POST since Rails respects the charset attribute in Content-Type, eg Content-Type: text/plain; charset=Windows-1252
would you rather we publish a PoC for a vulnerability that doesn't even have a patch yet? e.g self-hosted GitLab still hasn't shipped a newer version of Ruby that's patched...
The days of people feeling secure because they don't make egregious mistakes are unfortunately over. Now the rule is: You are vulnerable, you just don't know how.
So the recent RCE wave seems to be people finding more single byte overflows and such, but reporting them as RCEs because AI can do the tedious grunt work of finding the rest of the vulnerability chain.
If any single byte overflow can be converted into an RCE with minimal human effort then we have no choice but to prove the whole software stack is memory safe.
But are those generic exploits, that don't rely on specific dynamic library and kernel versions? i doubt it.
This is bad news for C/C++
Thought this was another vulnerability for a second, but for anyone else who thought the same, this is already covered in the Ruby advisory being discussed here https://news.ycombinator.com/item?id=50554038 (which covers six other vulnerabilities).
More interested to see how you can use just a single byte overflow to trigger RCE. Definitely achievable but sounds tough.
There should be other codepoints other than ß that in principle could be used for a vulnerability like that. There are even ones that expand to three codepoints, like ffi.
this relies on specific behavior with how the upcase function worked, the ß is the only one that expands in a way that works for this vulnerability.
Can you elaborate on what makes ß special enough to enable the vulnerability.
A quick search showed that there are other cases in legacy encodings that expand to multiple bytes.
For example 0xEF in ISO 6937 expands to CA BC 4E in UTF-8 after case transformation. Similar to ß this is a case with a single byte legacy encoding with a single lowercase unicode codepoint which has no precomposed upper case equivalent.
I suppose this function has been written first in assumption, that case conversion doesn't affect length, but later ß -> SS conversion has been added without proper testing.
There was never any guarantee that case conversion is byte length equivalent. Except for pure ASCII, that's just been an incorrect assumption from the start.
Ah, so that's the real reason "ß" is now allowed in uppercase too (https://en.wikipedia.org/wiki/%C3%9F)? Reducing the risk of security issues by removing an edge case?
The Unicode case mappings are covered by backwards-compatibility guarantees. "ß" is going to be mapped to "SS" forever.
It even seems the "more correct" uppercase form of ß is now ẞ, not SS.
> Traditionally, ⟨ß⟩ did not have a capital form, and was capitalized as ⟨SS⟩. Some type designers introduced capitalized variants. In 2017, the Council for German Orthography officially adopted a capital form ⟨ẞ⟩ as an acceptable variant, ending a long debate.[4] Since 2024 the capital has been preferred over ⟨SS⟩.[5]
But can the attacker specify the encoding in rails? It's not like UTF-8 or GTFO?
You can freely specify the encoding when sending multipart/form-data POST since Rails respects the charset attribute in Content-Type, eg Content-Type: text/plain; charset=Windows-1252
So you have to convert ISO-2022-JP, for example? That sounds like a disaster waiting to happen.
Clients have to do the same with server responses.
Name as discussed earlier here on Hackernews :) Glad they went with that name.
Scheiße2Shell?
One Shell a Day, Ops Run Away.
For once a bug name that's cool.
we were thinking of naming it ruby off rails haha, but this title ties into how this vulnerability works which was super cool
And the fact that you can almost read it ruby 2 hell
no poc. go away.
would you rather we publish a PoC for a vulnerability that doesn't even have a patch yet? e.g self-hosted GitLab still hasn't shipped a newer version of Ruby that's patched...
would be wildly irresponsible
took glm a bit over 20 minutes to write one, based on the report.
Django next? Although it's unlikely, Django is known to be above average in terms of security by now.
The bug here is in the C code for Ruby. Python is also written in C and just as likely to have memory bugs.
CPython.
The days of people feeling secure because they don't make egregious mistakes are unfortunately over. Now the rule is: You are vulnerable, you just don't know how.
Above average doesn’t cut it these days. And doesn’t Python have some of the strongest exposures to C libraries?
Well…
Uh oh. I guess it's being hammered with people with Red Team access right now.