Show full content
If you are terminally online like me (and a programmer) you’ve probably seen some form of Rust evangelism on the web. It’s a bit of meme, but one of the main arguments underpinning Rust is this:
Programs that are written in C and C++ have many recorded security vunerabilities. This is because C (I’m saying C for ease, take it to mean C/C++) allows you to write to any arbitrary memory address (along with many cases of undefined behaviour), without much push back from the design of the language. Therefore, people are more likely to create memory bugs in C.
Memory bugs are bad, because memory bugs can be exploited. If an attacker can exploit one of these bugs they could potentially read or write to arbitrary memory.
If an attacker can do that, they effectively have control of your system. It’s kind of (I imagine) a worst case scenario. Because then they can read your plain text passwords and/or crash your server. Or launch a nuclear missile.
So, what about a language that makes memory errors unlikely? Sounds good right? That’s what Rust does. Well, that’s what the Rust compiler does. Rust is essentially a systems language that was designed with a static analyzer in mind. Same cannot be said for C or C++.
All great right? Why the hell are we writing C++ if Rust exists? We need to switch immediately! Imagine funny Rust jokes and shenanigans.
In programmer world, you really can’t beat this argument. Because programmers are hyper-rational. And hyper-rational programmer people are obsessed by what can be measured.
Just look at the stats. Look at all of these security flaws. Look at windows/firefox/chrome, 70% of their vunerabilities are related to memory errors. Heartbleed, that other one that I can’t remember etc etc. On paper it’s just a no brainer. NONE of these would have happened if it were written in Rust (in theory).
But… hang on. What about all the code that doesn’t have vunerabilities? How do you measure when a memory error DIDN’T happen? How do you measure or notice something that just works and always worked? Seemingly, then, there seems to be a massive hidden dimensionality to these questions that isn’t being measured or can’t be measured. How many unknown unknowns are there? How does that relate to the known knowns?
I hear you though. You are hyper-rationalist programmer, you are probably thinking “well who cares if there are unknown unknowns, by using Rust we’ve addressed the ones we do know about”.
Well.. no. Not really, because shouldn’t the question really be, “What the fuck are we doing in the cases where there are no vunerabilities?”.
What’s the answer to that? Do you know?
The Rust case, often positions Rust to be the only viable option for memory safety (atleast when it comes to replacing C or C++). Don’t take this from me. This is the position of many Cyber Security Agencies who think the only way is to have a language secure by design. (https://www.cisa.gov/news-events/news/cisa-us-and-international-partners-announce-updated-secure-design-principles-joint-guide)
But this is just throwing the baby out with the bath water. Clearly. Because we have tonnes of safe code, and no one knows why its safe.
Except, they probably do. But no ones is asking the people who wrote the code. Or even talking about the fact it exists. The only solution is Rust adoption or else. How you write code, how you design code, what environment you are in, what your domain is, what the complexity of your problem is. None of that matters. Only the design of the language matters and Rust is the only language that is designed this way currently (even when its not).
How much programming wisdom, when it comes to how to design a memory safe program, is being chucked out the window to pursue a “security by language design” approach? Are we really going to sacrifice all of that because its a hard argument to make?
Rust on the other hand is an amazing argument. It really is. That’s only because it makes assumptions that are hard to disagree with if you don’t know what they are. But once you do, you realise they are kinda flawed.
And unfortunately, just because you can win an argument doesn’t actually mean you are right.
Having a “secure by design” language SPECIFICALLY to the detriment of everything else is not going to solve your security problems. This is a multi-front war.
This is analagous to World War 2 bomber design (bear with me). The prevailing wisdom at the time was to pile as many guns and armour onto bombers as possible, to prevent them being shot down. As the war went on they got more armoured. They had more mounted guns. Because, obviously? We don’t want our bombers shot down by enemy fighters!
However, what if you just flew really fast so the enemy can’t catch and shoot you? Then you don’t need armour and guns. If anything all of that stuff prevents you from pursuing the optimal strategy. Which is going fast! Fast forward to today. Do you notice how many bombers look like hench World War 2 Lancasters? None.
Rust and its “be all or end all” case for secure language design is the “pile all the guns onto the bomber” strategy. It is the singular pursuit of known knowns. That is a sure fire way to get stuck in a local minima.
We need diversity in strategy. We need to actually understand what security means and how existing programs that ARE secure, are written that way. Any acknowledgement of this is sorely lacking in any of the growing movement toward legislation. This is worrying. Because we could end up in a less secure future, where nobody understands why, with red tape that prevents you from finding out what went wrong.

