News for hackers. Stuff that matters.
Re:The next circle of security hell by mattstir on Monday November 23, 2026 @10:57AM (#50613967)
> I’d love to blame Rust for getting people obsessed about memory safety, and ignoring the kinds of vulnerabilities that aren’t caught by the compiler.

It's challenging to accept such a statement when the past 30 days have featured no less than six extremely high-profile memory safety bugs in critical infrastructure (PHP, Brotli, nginx, Java, Ruby...). No compiler can prevent bugs in application logic, but automatically catching the most common and exploitable class of bugs should be a compelling feature and it's surprising to see it positioned as somehow a bad thing.

Re:The next circle of security hell by odyssey7 on Monday November 23, 2026 @11:07AM (#50614153)
For real. With automated security vulnerability discovery and exploitation, security-by-thinking-very-very-hard isn’t really going to fly for much longer.
Re:The next circle of security hell by dralley on Monday November 23, 2026 @04:05PM (#50619258)
Thinking very very hard would be an improvement over the status quo in many C codebases.
Re:The next circle of security hell by loup-vaillant on Monday November 23, 2026 @05:01PM (#50620032)
I sense a false dilemma here. Thinking very hard isn't the only alternative to compiler-enforced memory safety. We can also use easier methods: https://www.dgtlgrove.com/p/untangling-lifetimes-the-arena-a...

In my experience over 90% of C/C++ developers are basically unaware of alternatives to fine grained allocation with malloc()/free() or new/delete. Many have heard of pool allocators, but they almost invariably see it as something even more complicated or tricky, applicable only in high performance code (meaning, not theirs). Very few have heard of arena allocation as a way to massively simplify lifetime management.

Now OK, temporal memory safety isn't the only problem. But it is the costliest and most difficult to solve at the language level. So imagine a langage that only helps with spatial memory safety (systematic bounds checks in debug or release-safe modes), and their programmers stick to the simpler allocation schemes like arenas.

It won't get rid of all the memory vulnerabilities. But it may very well get rid of enough of them that they cease to be a priority. It might even be a better tradeoff overall than a borrow checker or even a better security tradeoff, depending how much friction the borrow checker adds.

On the other hand, we should not underestimate the productivity boosts of strict static analysis, most notably type systems: I have experienced first hand the advantages of being told with ruthless precision why my pathetic attempt at a program didn't deserve to be even started. It's a tighter feedback loop than even a REPL (though I like it best when I have both), and speeds us up in many cases, including exploratory programming.

Re:The next circle of security hell by goodmythical on Monday November 23, 2026 @11:33AM (#50614677)
Multiple studies have found that drivers are deliberately more careful in cases of percieved or actual danger. The metaphorical extension being that someone driving with a chef's knife instead of an airbag is quite motivated to avoid hitting things.

I'm not sure why this wouldn't generalize to other behaviors including coding, and that's the argument against the "language1" is safer than "language2" discussion. Left with only that distinction, the coder is less likely to take extra precautions just as Americans who are safer wearing their seatbelt choosing to travel above the speed meant to be safe for the road and it's inhabitants, ignoring the fact that their seatbelt does not protect pedestrains or fauna.

That the lanuage does technically offer a statistical safety advantage provides no assurance against foot-gunning, despite offten being portrayed as such.

Re:The next circle of security hell by TheDong on Monday November 23, 2026 @11:49AM (#50614970)
The analogy you have at the start there doesn't match this situation because rust doesn't make it _harder_ to write memory safety bugs in the normal course of coding, it makes it impossible (excluding unsafe code, which truly is exceptional).

I don't know if there's really a good analogy for driving cars because it would have to be a completely eliminated class of error, like "drivers drive slower and are less likely to hit potholes when they perceive danger, i.e. on a road with many potholes, however if we eliminated all potholes in existence, drivers hit even fewer potholes".

Anyway, humans stopped coding sometime this year, so it's all kinda a moot point.

Re:The next circle of security hell by magnio on Monday November 23, 2026 @11:54AM (#50615053)
No one gives a shit how much care driver takes, only how common they cause accidents and how severe the injuries are. If wearing seatbelts increases accidents by 20% (which is a wild assumption already) but decreases injuries by 50% then that's worth it.

Same with coding: no one cares if you abstain from ASan and UBSan if the end result has no memory safety bug. Unfortunately, times and times and times and times again have shown that thinking "I just need to write perfect C code" does not help reduce memory safety bugs, while using Rust does.

Why? Because making a Rust program with more intricate memory access rules compile is way way more annoying than in C. This is intended.

> That the lanuage does technically offer a statistical safety advantage provides no assurance against foot-gunning

The zero-cost memory safety provided by Rust is enforced by the compiler restricting all kinds of foot-gunning, sometimes even stupidly (unlike in GC languages where the GC just cleans up all the bullet wounds). Saying Rust let users foot-gun themselves easily is one thing, but saying it's easier to foot-gun in Rust than in C is unfathomable.

Re:The next circle of security hell by arrowsmith on Monday November 23, 2026 @12:00PM (#50615164)
And yet we put airbags in cars
Re:The next circle of security hell by whatevaa on Monday November 23, 2026 @12:14PM (#50615449)
We call them footguns, but no foots are actually shot. At least not to the people who are responsible for avoiding them. Car accidents however can be life changing. So analogy to driving doesn't hold.
Re:The next circle of security hell by AnIrishDuck on Monday November 23, 2026 @12:22PM (#50615567)
> The metaphorical extension being that someone driving with a chef's knife instead of an airbag is quite motivated to avoid hitting things.

This analogy does not hold up. Nobody sane would seriously advocate that everybody drive around with a chef's knife just because it makes the driver more careful.

Humans make mistakes. We are exposed to the mistakes of other humans. There are factors that are out of our control.

The only serious approach to safety given this reality is defense in depth. Removing layers of defense because "it will make the humans behave more carefully" in other layers is fallacious reasoning.

Re:The next circle of security hell by AnthonyMouse on Monday November 23, 2026 @01:38PM (#50616786)
> Nobody sane would seriously advocate that everybody drive around with a chef's knife just because it makes the driver more careful.

That is the sort of thing some people advocate in the vehicle case though. They suggest reducing visibility etc. on purpose even though it actually makes it harder to avoid a collision because some drivers overcompensate and then the e.g. -15% you get from people being more cautious is more than the +12% you get from drivers not being able to see pedestrians as easily.

But there are a few problems with the theory. The first is that they hardly ever do long-term studies, and then people may not stay more cautious once they get used to the change even though you've permanently reduced visibility. The second is that if you make a road feel more dangerous then some people would avoid the road, and then you measure fewer collisions on it because it has less traffic, but you're only moving the collisions somewhere else while still actually reducing visibility on that road.

And the third is that it's a false dichotomy. There are ways to make a road less dangerous other than making it feel more dangerous, and we should prefer those over the ones that impose countervailing costs.

Re:The next circle of security hell by dralley on Monday November 23, 2026 @04:25PM (#50619551)
Who is the "they" that argue these things?
Re:The next circle of security hell by vhiremath4 on Monday November 23, 2026 @12:47PM (#50615979)
It might not generalize because the injuries sustained by software security bugs are less personal and irreversible than a car crash?
Re:The next circle of security hell by darksaints on Monday November 23, 2026 @01:41PM (#50616824)
And even if that driver drove around extremely carefully with the chefs knife instead of an airbag, the death rate would undoubtedly be higher at any comparable level of utility. The only safe way to drive like that is to not drive at all.
Re:The next circle of security hell by 3uruiueijjj on Monday November 23, 2026 @01:46PM (#50616907)
Regardless of the actual statistics regarding seatbelts, the analogy makes very little sense.

As a programmer I am not the driver. If I was, I might truly be more careful. But the drivers are people far away that I don't know and don't really care about.

Re:The next circle of security hell by MattPalmer1086 on Monday November 23, 2026 @01:57PM (#50617130)
Because there is no real negative personal consequence for shipping unsafe code faster. To the contrary, that behaviour is often rewarded by organisations.
Re:The next circle of security hell by AnthonyMouse on Monday November 23, 2026 @02:03PM (#50617260)
Isn't that the actual problem though? It doesn't matter if you use Rust if you use "unsafe" everywhere because it's faster than doing it right.
Re:The next circle of security hell by dwattttt on Monday November 23, 2026 @02:07PM (#50617311)
It's not perfect or absolute, but the unsafe way in Rust is often harder. As the simplest example, raw pointer operations have less syntactic sugar, so using them is less ergonomic.

Other avenues for bad are still there though.

Re:The next circle of security hell by AnthonyMouse on Monday November 23, 2026 @02:20PM (#50617553)
> As the simplest example, raw pointer operations have less syntactic sugar, so using them is less ergonomic.

It's more typing, but it's also less thinking because you get the code to compile immediately. And if you don't like typing then that's easy, just write "unsafe" once inside a function that you can call in 500 different places.

At some point you have to actually care or it's not going to work out.

Re:The next circle of security hell by dralley on Monday November 23, 2026 @04:24PM (#50619531)
Have you ever written Rust, much less unsafe Rust? It does not sound like you have, to be honest.
Re:The next circle of security hell by dwattttt on Monday November 23, 2026 @04:35PM (#50619698)
> just write "unsafe" once inside a function that you can call in 500 different places

It's usually the opposite. If you're being forced to write unsafe, odds are there's a crash bug about to appear (the word "forced" was very specifically chosen, I've been in both of these positions quite a few times).

And if you're not being forced to write unsafe, not writing it really is easier. Precedence of operations means that if you want to call a method/access a field of a raw pointer, it's a minimum of `(*a).` to reference it. A reference is just the `.`.

Re:The next circle of security hell by dralley on Monday November 23, 2026 @04:09PM (#50619336)
My frustration with many anti-anti Rust arguments is that they are basically strawmans. "Use unsafe because it's faster"
Re:The next circle of security hell by shanemhansen on Monday November 23, 2026 @03:24PM (#50618705)
I think you're not thinking your analogy through.

I've made a plugin to valgrind that stabs the engineer with a knife when they do unsafe things. Does the engineer accomplish their next task with rust or C?

Re:The next circle of security hell by pcwalton on Monday November 23, 2026 @04:53PM (#50619930)
Fortunately, we have statistics to show that actually Rust does reduce memory safety vulnerabilities, so we don't have to speculate about whether it actually helps.
Re:The next circle of security hell by skydhash on Monday November 23, 2026 @11:42AM (#50614840)
Engineering is about tradeoffs. Memory safety vs currently working software needs to be a carefully considered position. It's not like Rust is a add-on tooling that you add to your workflow. Rewrite are costly, not because of the time to write code, but the effort required to make sure that every spec is replicated to each exact details. And even Rust advocates are not willing to pay it (other than a few random cases).
Re:The next circle of security hell by hansvm on Monday November 23, 2026 @12:16PM (#50615469)
Luckily there haven't been any critical vulnerabilities in high-profile Rust code discovered the past 30 days like HTTP request smuggling in Actix, UAF DF and OOB in SurrealDB, OOB in Apache Arrow, sandbox escapes in wasmtime/cranelift, sandbox escapes in cap-primitives....

Whether this is true or not, it's positioned as a bad thing because time and effort spent on memory safety isn't purely an additive benefit. It can actively reduce memory safety (high-perf Rust software needing more unsafe than we care to admit, and unsafe Rust being harder to write correctly than normal C), and it can fight against time spent focusing on other serious vulns (e.g., the cap-primitives issue is important because we're failing to do things as simple as when we run literally arbitrary code bothering to make sure it's the right code).

And that's only from a security perspective where legitimately informed and intelligently people disagree about whether Rust actually reduces vulns in high-performance code (again, whichever side you fall on, that's the argument being made). There's additional pushback against Rust when people would otherwise be silent about its security shortcomings because it has enough other tradeoffs in its design to hinder other metrics developers care about, like speed of feature delivery (or, in the age of vibecoding, cost of tokens and therefore also speed of correct feature delivery).

Re:The next circle of security hell by imtringued on Monday November 23, 2026 @03:01PM (#50618277)
Dude, other than the sandbox escape vulnerabilities none of the ones you listed matter all that much compared to even the most basic buffer overflow in C, which is an instant RCE aka complete loss of the process. The fact that people still don't understand how bad an RCE is crazy to me.

There are a bunch of in-process security measures you can take if you do not have an RCE, none of them matter with an RCE.

Re:The next circle of security hell by stickfigure on Monday November 23, 2026 @01:40PM (#50616809)
Rust's standard library is full of unsafe code.

If we're going to beat up on Java for having some bad hand optimized internals... guess what, Rust has it in spades, with more than a dozen memory corruption CVEs over the years.

Yes, memory-safe languages are better for application development. But Rust is not unique here; most GC'd languages satisfy the requirement.

Re:The next circle of security hell by imtringued on Monday November 23, 2026 @02:25PM (#50617638)
This is something I'm getting irritated over.

I thought about what hardening techniques there are for dealing with RCE in a process but short of SELinux policies I can't really think of anything that might help.

The problem is ultimately that any RCE can overcome any in-process security mechanism you come up with. If you have an RCE, the security logic has to be enforced by a process that is not a victim of an RCE.

The best way to deal with a threat model with inevitable RCE is to ultimately give up and come up with a general RCE mitigation.

For example, a hypothetical ISA could mark valid entry points for functions and if you skip them, the process aborts. This prevents using just the last instruction of a gadget but ultimately I think even that type of mitigation is useless against an LLM. You are simply better off doing your bounds checks.

I'm talking about RCEs, because most in-process security measures work best if they cannot be bypassed and an RCE is always an implied bypass.

Re:The next circle of security hell by dcrazy on Monday November 23, 2026 @03:00PM (#50618271)
> For example, a hypothetical ISA could mark valid entry points for functions and if you skip them, the process aborts.

OpenBSD implemented this for syscalls: https://man.openbsd.org/pinsyscalls.2

Re:The next circle of security hell by kibwen on Monday November 23, 2026 @04:00PM (#50619200)
> Rust the language does not operate on the C concept of ambient authority. Rust's STD unfortunately does.

Rust's standard I/O abstractions are intended to be cross-platform, which means they're unfortunately going to be approximately the lowest common denominator of what the platforms natively provide. If you're okay with not strictly adhering to cross-platform abstractions, then the cap-std crate is the state of the art: https://crates.io/crates/cap-std

Re:The next circle of security hell by lightedman on Monday November 23, 2026 @06:27PM (#50621013)
"hardening techniques there are for dealing with RCE in a process but short of SELinux policies I can't really think of anything that might help"

Forcing hardware makers to be responsible for the first 3 layers of the OSI model would be a great start.

Re:The next circle of security hell by LtWorf on Monday November 23, 2026 @03:13PM (#50618491)
> extremely high-profile memory safety bugs in critical infrastructure (PHP, Brotli, nginx, Java, Ruby...)

You realise they are memory managed languages right?

Re:The next circle of security hell by TonyTrapp on Monday November 23, 2026 @03:32PM (#50618830)
PHP is not written in PHP. Ruby is not written in Ruby. The bugs were in C code. The fact that a language is meant to be memory-safe doesn't mean its actual implementation is.
Re:The next circle of security hell by LtWorf on Monday November 23, 2026 @05:53PM (#50620583)
Rust is not written in rust… well it is but it needs to be bootstrapped from C.

Also it contains a ton of unsafe.

Any other wisdom you wish to share?

Re:The next circle of security hell by ratmice on Monday November 23, 2026 @04:37PM (#50619736)
It doesn't seem like he's talking about logic errors, the focus on package managers of his previous post seems to comment on the overall build process where cargo/build.rs is compiled to a binary and then executed during the build phase without any sandboxing or isolation.

Making it extremely easy to collaborate with large numbers of packages and maintainers, while also making it difficult to audit (packaged source code not linked to a particular git commit).

There are plenty of valid complaints that don't touch application logic or memory safety. Coming from someone who likes aspects of rust despite these problems, there is certainly room for improvement at the package ecosystem levels.

Re:The next circle of security hell by ForHackernews on Monday November 23, 2026 @05:08PM (#50620096)
This is true, but it doesn't necessarily follow that we have to rewrite everything in Rust: https://fil-c.org/