by mrguyorama · 2y ago · 0 comments
I'm not convinced of the memory safe language hype train honestly. Every single application could be 100% bulletproof and we would still live in a world where the CFO downloads a random exe from a phishing email and runs it with admin privileges. That still seems to be the main way institutions and people are compromised. We make jokes about "you can't defend yourself from a nation-state actor" but half the time the primary infection point for everything from North Korea to 15 year old Kevin playing with MyFirstRansomeware is to just put it in an email and let people do the work for you, or copy a log in page and let the user give you their credentials.
Edit: lol people very very very angry that I dared to say "hey maybe rust ain't gonna save our world".
Jesus guys. Have some nuance.
And be sure you don't cite reasons why you need unsafe callouts to unsafe capabilities. Nobody denies that.
Explain why you need a language that is pervasively unsafe, unsafe by default. Explain to me what code you are writing that has to routinely access memory outside of arrays. Explain to me what code you are writing that simply must be able to use pointers to access memory in unsafe ways.
In a nutshell, explain what these amazing benefits are to memory-unsafe languages that somehow offset the many and manifold costs we've found over years of usage.
Memory safety in a modern language is not only virtually free, it's a positive benefit. I simple do not see an argument for memory unsafe languages, especially given that every single one of them ship with "unsafe" capabilities available on demand and fully documented.
(Also recall "memory safe" does not imply Rust. Rust is a particularly strong language on that front, sure, but memory safety is basically every currently-used language except C and C++. People advocating for memory safety are not advocating for everything to be moved to Haskell or Rust.)
So why? Why should we keep using memory unsafe languages? It's all cost and no benefit. Who wants that?
(The only practical answer is "I've got a system here written in C/C++", and I concede the engineering pressures that can keep you there. But my personal opinion at this point is that greenfielding a project in C or C++ without adjoining a strong code analysis on day one is rapidly approaching, if not already reaching, professional negligence. And I've got my stink eye on C or C++ with strong code analysis.)
Well, if the CFO has admin you’ve already failed several audits but in general, yes, there are multiple categories of risk which you have to protect against. That doesn’t mean it’s not valuable to reduce one of them, however – in addition to the direct risk reduction, it also frees up time to work on the others.
No one cared. This is normalcy for most people.
Even if the "it only works on bare metal" thing was true, and its hardware key device may make that a reality, there's zero reason to let people browse on it. Or leave it online 24x7, one could bring a switch port up/down when needed.
Ah well. As you say, this is normal.
Look - on the level of coding vulnerabilities, memory safety is by far the biggest problem. You want to talk about phishing attacks and privilege management, fine. There's a bunch of different controls for those.
We would never address anything following the path of what-aboutism.
I think a lot of people here forgot that most businesses aren't huge corporations or tech oriented. Most businesses probably have less than 50 people and non-professional "IT Support" ie, the owners grandson who is "good with computers".
The amount of door wide open security stances I've seen working with small to mid-size businesses is like 75%. The difficulty of prying local admin away from the owner of a concrete company is quite high. It's all very ephemeral and hard to explain to non-tech savvy people.
Turning on MFA for everything possible, aggressive AV, social engineering/phishing training, and removing local admin daily drivers probably solves 99.99% of malware.
Memory safe software would be great, yes, but it really isn't the problem.
Or that exe tries to connect to other services in the network to exploit a buffer overflow on another system. An example of such an exploit was EternalBlue.
So yes, you're probably right that from a purely external perspective, attackers are unlikely to gain initial access using exploits targeting memory safety. However, once they are in, there are all sorts of memory safety bugs that could be used.