Ruby2ßhell: Pre-authentication RCE on stock Rails
https://verialabs.com/ruby2shell/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.
Now, in web-facing systems, the biggest concern is the low-level crypto libraries, which need to be written in assembly to avoid timing attacks. These (and related libraries) have seen multiple security advisories in the past year, some related to unsafe (I think?) and some related to logic errors. But overall, those advisories have mostly been lower priority, or affected mostly niche use cases.
If you only have a small amount of unsafe code, then it's possible to audit it more aggressively. And there's only a limited amount of space for bugs. So what I would expect for Rust is a trickle of security bugs, many of them niche or low severity, that slows down with time.
... against str::to_uppercase the Rust function which has a single line of unsafe code, with a two line rationale provided to explain why it's OK to do this. As a subject matter expert I agree with the rationale. LGTM.
Edited: We're talking about uppercase, they're basically mirrors, but we should choose the uppercase function.
No, it's not. A relatively common case for unsafe in Rust is in data structures. The data structures in the Java runtime are all written in Java and has almost no use of unsafe (there might be a few, but not becsause of language limitation, but because of initialisation order).
As for the JVM, much of it is a compiler. It doesn't matter what language it's written in, as it generates machine code. Indeed, the vulnerability disclosed yesterday was in a compiler intrinsic, but those are just as common in Rust.
Other than that, the other big piece in the JVM is memory management, and it does, indeed, use C and C++ for memory management, but Rust also uses C (the various implementations of malloc/free in whatever runtime the Rust program is using; BTW, some popular malloc/free implementations are almost as big as Java's most complicated GC).
As for native C/C++ libraries (outside the JVM itself), Java programs do use some, but generally not more than Rust programs.
For an example of the latter (LLVM is just nonsense): LLVM still today has a bug found years ago where pointer provenance (a legitimate but hard to think about idea for optimising compilers) accidentally leaks into integers, and so LLVM can end up with two integers a, b which it believes are not equal and yet a - b == 0. Boom.
Not everyone on the web is looking to start an argument; some people use literary devices to reinforce their point. If anyone is defensive about a point nobody made, it’s you.
Of course I'm not sure how much it counts to be "using a memory safe language" when you have to call put to unsafe code anyways. I.e. just because the library you'd like to use is C but the rest of your project is Rust doesn't mean you're really using a me ory safe language, it means you're sometimes using one. We have a long way to go before environments allow using memory safety fully I think.
The perception of Java as being insecure on the server was only a thing amongst those who hadn't used it much since the Java plugin era.
That's why the Log4j vulnerability was a huge deal.
I like Rust, but this kind of anti-Java-think is super dated and boring.
PS Its the height of irony that the layer protecting Java webservices IS less secure than the Java webservice itself.
PPS The Java memory model is just superior to Rust's in every way...deal with it.
(Correct me if I'm wrong!)
Now to get people to use them it's an issue.
[1]: https://projectzero.google/2014/08/the-poisoned-nul-byte-201...
Exploitation conditions are likely more challenging today but that’s the earliest reference I know for exploiting a single byte overflow.
From the blog post:
The output buffer is allocated as the input length plus 20 bytes. Each ß adds one byte to the output, so an input with 21 of them overflows the buffer by one byte.> 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]
They did not. Participants from Liechtenstein and Switzerland don't even care about that letter (Swiss orthography does not make use of it), so they are not even a good place to begin such debate.
But that is wrong. In german I only know of ß aka downcased version.
ẞ seems another character. I have no idea what it is, other than looking close to ẞ, but it most assuredly is not existing in the german language. There is simply no uppercased variant. 'ss' is "Doppel-s' - that is not ß. In german we have "das" (which is the), but it can be "das" or "dass" depending on the sentence, in particular after a ',' character. I often misspell it, since I prefer "das", when in reality sometimes one has to use "dass". But 'ß' is very different to that - to claim that 'ß' is equivalent to 'ss' is simply incorrect. I have no idea who that "Council for German Orthography" is, but clearly they don't know anything about German. Who put that Council in charge of anything? Are these drunks? The claim that the capital has been preferred, is also factually wrong. Who is writing all that?
Edit: Oh I see, you have that from Wikipedia.
The .pdf can be found here:
https://www.rechtschreibrat.com/DOX/RfdR_Amtliches-Regelwerk...
So from what I can see, this is only the:
"Leibniz-Institut für Deutsche Sprache"
That is not a unified authority for anything. It is totally unclear to me why the wikipedia article claims that this is legally binding for anyone. That's just factually incorrect. Is Wikipedia no longer proofreading?
Edit: The Leibniz-Institut is just the publisher. The author, the Rat für deutsche Rechtschreibung, is legitimized by the German (and six other countries') government.
The Duden is also seen by many as authoritative and also knows and allows the capital ß: https://www.duden.de/sprachwissen/rechtschreibregeln/doppel-...
Edit 2: It's also not illegal to use whatever made up rules you want. Nothing about this is legally binding anywhere.
> I often misspell it, since I prefer "das", when in reality sometimes one has to use "dass".
It's confusing because both can mean "that".
"That is true." = "Das ist wahr."
"He said that it is true." = "Er sagte, dass es wahr ist."
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.
> Non-ASCII case mapping and folding are supported for UTF-8, UTF-16BE/LE, UTF-32BE/LE, and ISO-8859-1~16 Strings/Symbols.
ß might actually be the only character that expands to multiple bytes on the original encoding from that list of ISO encodings.
EDIT: Thinking about it, my example from above should work with UTF-16 input.
U+0149 is a single lower case BMP codepoint, so two bytes in UTF-16. It has no precomposed uppercase, so it turns into two codepoints and 4 bytes in UTF-8 and UTF-16.
1. ÿ (LATIN SMALL LETTER Y WITH DIAERESIS) is in ISO-8859-1, but Ÿ (LATIN CAPITAL LETTER Y WITH DIAERESIS) is not - however, theres this thing called Windows-1252 which is often treated as equivalent, where it is.. but not in the same place as in ISO-8859-15.
2. The Unicode (and correct) uppercase of µ (MICRO SIGN) is Μ (GREEK CAPITAL LETTER MU) which should look like M (LATIN CAPITAL LETTER M) .. only the latter can be expressed in Windows-1252.
3. The ISO-8859-12 encoding is a lie.
I think one may now decide to publish the PoC straight away or not publish it at all, since an AI agent pointed at this post would very likely be able to produce one in a few minutes.
Browsers stopped auto-detecting ISO-2022-JP for this reason.
He made rails for humans not for speed.
would be wildly irresponsible
I doubt you have a PoC at all