> 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.
For real. With automated security vulnerability discovery and exploitation, security-by-thinking-very-very-hard isn’t really going to fly for much longer.
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.
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.
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.
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.
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.
> 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.
> 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.
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.
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.
Because there is no real negative personal consequence for shipping unsafe code faster. To the contrary, that behaviour is often rewarded by organisations.
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?
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.
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).
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 intelligent 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).
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.
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. Edit: Rust the language does not operate on the C concept of ambient authority. Rust's STD unfortunately does.
> 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
One question that has always puzzled me is why maintainers keep complaining without doing the obvious: just keep whatever pace you want, and signal to users that you simply cannot follow up the pouring of security issues —- please contribute back and use at your own risk.
It seems that some OSS projects have this complaining culture that maintainers keep complaining about things such as corporations taking the code without code or monetary contribution, and the mounting security issues, without doing much of it. I guess it’s because I’m not a product people in my heart. Everything I dumped on GitHub is just for myself to record and I don’t really care whether anyone uses or not. But people with a product mind feels that they want as many people to enjoy their products, so they feel certain responsibilities to fix everything, but then get burned by the human side of the things.
I think it’s because a lot of open source developers have a cultural memory of struggling to get permission to use open source in the first place. Skipping security patching is what rolls that back until your choices will be Microsoft and Red Hat.
That, and the previous events told me that the current OSS model is not exactly working. It works when it works but for many OSS projects out there it doesn't work. I don't know what's the solutions people are going to try out, but essentially, this might be a bigger problem than I thought.
As a company you have 3 options, you let employees use open source or: 1. write it yourself for 1x-5x-10x the amount of resources 2. license it from a big vendor for $$$ If they want to get (even more) entrenched into the dogcrap that microsoft is doing lately, be my guest, I will lose 0 sleep over this. What is the "struggling" here?
> 1. write it yourself for 1x-5x-10x the amount of resources
But our new CEO¹ says we are all going to be 10x-15x-20x more productive if we fully embrace AI, so we'll at worst break even and maybe even be 20x ahead!!!!1!!!!!! -------- [1] I don't know if it is for show, if he is completely naive and believes what he is saying, or if he thinks everyone else is thick and will take his word as gospel, but I think his “everyone will be 10x or more productive”, “but it will be easier, not more stressful”, and “it won't affect jobs at all”, is an impressive collection of BS.
Not sure why Red Hat (or say Canonical) would remain a choice in this case. It took them forever to handle CVE-2026-98432. Meanwhile Debian patched right away.
I don’t use llms to code, but I have to deal with vibecoded code and that is in itself a risk, but it also pushes me to do a lot of work and lower my guard, some coworker or client sends you a 10kloc project they made in a day and now you have like 20 hours of work to just review the code if I want to work at my pace. writing code without an llm agent is already an extreme position which makes me almost unemployable, if I had to add the restriction of not working with vibecoders I wouldn’t even get volunteer or shitty work
Interesting that some places still allow people to not use LLM. I’m looking for such places —- but looks like your team is already using LLM so it’s sooner or later.
"Interesting that some places still allow people to not use C"
That was the reality when I started programming. Then the compilers got good enough that no rational person or organization would program in assembly language. For a while, we would use the C compiler and then tweak the assembly by hand. Can't remember the last time I did that.
I think for OSS to succeed, they gotta have corporation support -- it's either they hire people who contribute back, or they directly send money. Linux is the perfect example. ESR called it the Bazzar, which might be true before 2.0, but after that I think it is mostly the companies that contributed the most important code so that, eg, the companies themselves can use it without licensing costs. So it's more like the Catholics (Cathedral) against the Protestants.
I'm not so sure. All I know is that the current situation is not healthy and I think a world with less direct corporate involvement and more diverse, "throw it over the fence", not for reputation building projects on the one hand and more corporate funds directed transparently into initiatives would be better.
"I’ve been also doing meaningless version bumps (with no real changes or no changes that applied to Gentoo) so that our packages don’t get reported as being “outdated”. It’s a hassle and it sucks, but it saves people from worrying."
How else would you communicate to users: "We checked and we think we are not impacted by the upstream release"? Now I know a version bump does not exactly mean "we checked". But both users and tools seem to have that as the implicit semantics.
Who do we blame on the security nightmare we all live in?
All of us. There has been a long time misunderstanding of computers by pretty much everyone for as long as they've been around. And that is computers are dangerous. Much in the same way weapons grade uranium can be dangerous. The thing is each computer in of itself isn't that dangerous. It's an emergent phenomenon where you reach a critical mass and suddenly all your computers can become an explosive problem. And because of that nature you can't point your finger at one particular person, at one particular platform. At one particular choice and say "that's the fault right there". It's all of us that created this problem at will take all of us to get out of it. Now, I have a particular beef with the responsible disclosure people for ignoring Darwin. They did an excellent job of hiding the dangers of computers for decades under the guise of "people will play nice and you'll always have time to fix your problems before they are ruthlessly exploited". We today we should all know that idea is dead, buried, and the bones have turned to dust. There are likely a great number of things we are going to have to decouple from networks unless we want to continuously have them presenting dangers to users and the public at large.
Comments (165) 36 threads
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.
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.
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.
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.
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.
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.
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.
Continue this thread — 2 replies
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.
Continue this thread — 9 replies
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?
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 intelligent 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).
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.
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.
Edit: Rust the language does not operate on the C concept of ambient authority. Rust's STD unfortunately does.
OpenBSD implemented this for syscalls: https://man.openbsd.org/pinsyscalls.2
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
Continue this thread — 1 more reply
Continue this thread — 3 more replies
It seems that some OSS projects have this complaining culture that maintainers keep complaining about things such as corporations taking the code without code or monetary contribution, and the mounting security issues, without doing much of it.
I guess it’s because I’m not a product people in my heart. Everything I dumped on GitHub is just for myself to record and I don’t really care whether anyone uses or not. But people with a product mind feels that they want as many people to enjoy their products, so they feel certain responsibilities to fix everything, but then get burned by the human side of the things.
As a company you have 3 options, you let employees use open source or:
1. write it yourself for 1x-5x-10x the amount of resources
2. license it from a big vendor for $$$
If they want to get (even more) entrenched into the dogcrap that microsoft is doing lately, be my guest, I will lose 0 sleep over this.
What is the "struggling" here?
But our new CEO¹ says we are all going to be 10x-15x-20x more productive if we fully embrace AI, so we'll at worst break even and maybe even be 20x ahead!!!!1!!!!!!
--------
[1] I don't know if it is for show, if he is completely naive and believes what he is saying, or if he thinks everyone else is thick and will take his word as gospel, but I think his “everyone will be 10x or more productive”, “but it will be easier, not more stressful”, and “it won't affect jobs at all”, is an impressive collection of BS.
That's the "none was fired for buying IBM mentality".
Continue this thread — 2 replies
I don’t use llms to code, but I have to deal with vibecoded code and that is in itself a risk, but it also pushes me to do a lot of work and lower my guard, some coworker or client sends you a 10kloc project they made in a day and now you have like 20 hours of work to just review the code if I want to work at my pace.
writing code without an llm agent is already an extreme position which makes me almost unemployable, if I had to add the restriction of not working with vibecoders I wouldn’t even get volunteer or shitty work
That was the reality when I started programming. Then the compilers got good enough that no rational person or organization would program in assembly language.
For a while, we would use the C compiler and then tweak the assembly by hand. Can't remember the last time I did that.
Continue this thread — 7 replies
It all changed when it turned into a competition to show off and please companies and with the rise of permissive licenses.
Continue this thread — 1 reply
Continue this thread — 4 more replies
How else would you communicate to users: "We checked and we think we are not impacted by the upstream release"? Now I know a version bump does not exactly mean "we checked". But both users and tools seem to have that as the implicit semantics.
Continue this thread — 6 replies
All of us.
There has been a long time misunderstanding of computers by pretty much everyone for as long as they've been around. And that is computers are dangerous. Much in the same way weapons grade uranium can be dangerous. The thing is each computer in of itself isn't that dangerous. It's an emergent phenomenon where you reach a critical mass and suddenly all your computers can become an explosive problem.
And because of that nature you can't point your finger at one particular person, at one particular platform. At one particular choice and say "that's the fault right there". It's all of us that created this problem at will take all of us to get out of it.
Now, I have a particular beef with the responsible disclosure people for ignoring Darwin. They did an excellent job of hiding the dangers of computers for decades under the guise of "people will play nice and you'll always have time to fix your problems before they are ruthlessly exploited". We today we should all know that idea is dead, buried, and the bones have turned to dust.
There are likely a great number of things we are going to have to decouple from networks unless we want to continuously have them presenting dangers to users and the public at large.
Continue this thread — 11 replies
All comments shown.
Couldn't load more comments. Check your connection and try again.