Hacker News
points by cowlevel 1 day ago | 0 comments
The bug is integer overflow in a random C data-processing library (specifically regexes) leading to RCE.

Who else is tired of C libraries since this week?

[–] Gigachad 1 day ago
I've been calling this out for forever now and have been repeatedly told that actually, competent devs with C are fine and the C software we use has been battle tested so it's largely secure.

And now we are seeing that was all untrue.

[–] cristoperb 1 day ago
now it's even more battle tested!
[–] angry_octet 18 hours ago
"AI Battle Tested!"
[–] awesome_dude 1 day ago
Let's rewrite everything - said every 15 minutes by every new developer with a new toy.

How about being constructive instead - old bug in old code is no surprise, no matter the language/technology.

[–] Gigachad 1 day ago
This was hardly a convincing argument before the current CVE explosion. By now C needs to be dead and buried for network accessible code.
[–] eviks 1 day ago
How is this constructive when you're offering nothing to construct? Just saying not to be surprised.
[–] awesome_dude 1 day ago
You really think it wasn't constructive - is that a you bias or a me bias?
[–] dvdkon 22 hours ago
Sorry, it's you. You basically told people that they should expect bugs in old code and shot down the proposed fix without offering any other solution; that's non-constructive by definition.
[–] cowlevel 17 hours ago
tbf "rewrite everything" isn't a very constructive statement either.
[–] grumbelbart2 17 hours ago
Which options are there, really? There is re-write, fixing, and mitigation.

We have a lot of legacy code that probably contains many bugs that could be exploited.

We could either stop using that legacy code, i.e. re-write and move to a newer library / package. Or fix the old code.

I now believe that "fixing" the code is actually in reach for an organization such as Google, which has deep pockets, frontier AI models, and a history of working on open source. Spend a few billions to walk through every package that runs on a common Linux installation, find potential issues and robustify the code.

[–] grg0 1 day ago
And how does Rust help? As far as I know, an integer overflow in Rust panics in debug but just wraps in release (a bad choice in my opinion). Would it help specifically in the code execution part of the exploit?
[–] jooops1 1 day ago
The key difference is even If an Integer overflows in Rust It still doesn't violate memory safety in safe Rust and therefore doesn't lead to exploitation.
[–] dgrunwald 22 hours ago
Depends on what kind of exploitation you're talking about -- integer overflows can still cause out of memory conditions and crash the program, which is a denial-of-service vulnerability when talking about webapps.

But yes, memory-save languages like Rust are a massive help protecting against remote code execution. (unless said memory-safe language introduces its own category of RCE vulnerabilities, e.g. deserialization in Java)

[–] jeroenhd 22 hours ago
The integer overflow issue is only part of the problem. There are a couple underlying issues that make this exploit feasible: certain regexes produce extremely long bytecode, the integer overflow issue, and finally, a double free.

Rust will not protect you against exploding regexes, it will not protect you against integer over/underflows (unless you specifically call safe wrapping methods), but it will protect you against double frees if you use it sensibly (nothing prevents you from breaking the borrow checker and messing up memory if you write an unsafe {} block).

[–] Fordec 1 day ago
[profile.release] overflow-checks = true
[–] ferrisjoke 1 day ago
I've heard the joke many times, but I didn't expect that even programming would ever end up wanting to evolve to crabs.
[–] jeroenhd 22 hours ago
Xe Iaso's blog posts poking fun at C(++) titled '"No way to prevent this" say users of only language where this regularly happens' has been quite busy this month.

Getting rid of C isn't the holy grail it might appear to be (Ubuntu has been working hard at rewriting sudo and coreutils in Rust and they have had plenty of bugs in the process), but I do hope the C projects will preemptively start fuzzing/running fil-C/invent new safety mechanisms for old code.

[–] awesome_dude 10 hours ago
> but I do hope the C projects will preemptively start fuzzing

One of the points I wish more people understood about fuzzing is what it is doing is grabbing a random selection of all the possible inputs and running them through the function (Yes the fuzzer can be made to target/exercise different branches in the code, but it's still doing that with a random selection of the possible inputs that will exercise said piece of code).

Fuzzers miss bugs, because the full corpus of possible inputs is impossible to permutate through every function.

But the advantage of fuzzers is that they choose inputs that developers never think to try on the code.

edit: some back of the envelope AI math:

To enumerate every unique state of a 64-bit variable, you must iterate through 18,446,744,073,709,551,616 individual inputs (2⁶⁴).

The exact time in seconds depends entirely on the processing speed of the system executing the loop. Here is how the time breaks down across three different performance levels:

1. Standard Desktop CPU (1 Billion operations/sec)

• Time: 18,446,744,073 seconds

• Scale: Roughly 584.5 years

• Context: If a single core on a modern processor handles roughly 1 billion state evaluations per second (1 GHz efficiency), it would take nearly six centuries to finish.

2. High-End Multi-Core Processor (4.3 Billion operations/sec)

• Time: 4,294,967,296 seconds

• Scale: Exactly 136.1 years

• Context: If you maximize a consumer CPU utilizing multiple threads or an incredibly high single-core instruction-per-clock rate (4.29 GHz efficiency), it still takes well over a human lifetime.

3. High-End Enterprise GPU / Supercomputer Cluster (1 Trillion operations/sec)

• Time: 18,446,744 seconds

• Scale: Roughly 213.5 days

• Context: A highly optimized, massively parallel hardware setup—like an enterprise GPU cluster capable of churning through 1 Terahash/Tera-iteration per second—can shrink this problem down to a matter of months.