The Software Safety Project

The Fix We Chose Not to Use

Episode Summary

For decades, the software industry has made memory safety attacks harder instead of making them impossible. Yet at Microsoft and Google, roughly 70 percent of serious security defects have been memory safety bugs. Why haven't memory-safe languages like Rust and hardware protections like CHERI taken over? Microsoft's Dave Weston, Google Project Zero's Natalie Silvanovich, Cambridge's Robert Watson, former DARPA program manager Dan Wallach and others explain, from the cost of rewriting old code to software licenses that leave the bill with everyone but the software maker.

Episode Notes

In episode one, we traced a thirty-year-old bug back to its source. In episode two, host Sarina Gandy follows the money. The software industry has spent decades making memory safety attacks harder and more expensive, yet at Microsoft and Google roughly 70 percent of serious security defects have been memory safety bugs. She talks to people who led Rust adoption at Google and Android, and to the researchers behind a chip design called CHERI, to find out what fixes the problem, why the fixes are not everywhere yet, and who pays when they aren't.

Guest List

On mic

In writing or quoted, not on mic

Chapters

0:00 The fix we chose not to use
0:36 Where we left off
1:15 Why the defenses never fixed it
4:21 The 70 percent problem
5:02 Rust, the fix that worked
7:21 What happened at Android
9:12 Who pays
11:31 Why not just switch?
15:02 The case against
19:25 CHERI: safety built into the chip
21:47 Why no one is asking for it
25:33 The fine print
28:41 A company can choose

Referenced in this episode

Credits

The Software Safety Project is a production of the Software Safety Institute.

Listen to all episodes, and find the show on your favorite app, at podcast.softwaresafety.org.

Episode Transcription

Episode 2 Transcript: The Bug We Let Live

The Bug We Let Live is a production of the Software Safety Institute, with generous support from Cyber Florida. Produced by Sarina Gandy. Co-produced by Rex Wilson.

Runtime: 33:01.

Speakers

How to read this transcript: [m:ss] marks the start of each speaker turn. A dash marks a cut or interruption in the audio. Written quotes and archival audio are labeled in the speaker name.

0:00 The fix we chose not to use

[0:02] Robert Watson: I'm sure the attackers didn't mean to turn off MRIs and cancel life-saving surgeries. But the impact of that on real people was huge. That kind of thing is preventable through the technologies we have. The problem we have is that we've chosen not to deploy those technologies.

[0:17] Sarina Gandy: Welcome to episode two of The Bug We Let Live. I'm Sarina Gandy. That was Doctor Robert Watson, a professor at the University of Cambridge, on WannaCry, the 2017 attack that shut down hospitals across England. He says the fix was already in our hands. So why didn't we use it?

0:36 Where we left off

[0:36] Sarina Gandy: Last time, we followed the history of one of software's greatest mistakes: memory unsafety bugs. We heard about a woman in London who waited months for a scan after an attack hit her hospital, and we traced the explosion of the mistake back to a paper published 30 years ago. At the very end, Doctor Crispin Cowan, who built one of the first defenses against this bug, said the reason it's still here isn't technical. It's economic. So this time, I followed the money.

1:15 Why the defenses never fixed it

[1:15] Sarina Gandy: Last time, the Software Safety Institute's Bob Lord gave me a long list of defenses that have already been tried to solve memory unsafety. All of these defenses were powerful, but at the same time, they weren't able to solve the root cause of the problem that lives in memory-unsafe languages like C and C++. No matter how brilliant the defense, attackers kept finding ways around. It's been a decades-long game of whack-a-mole. I spoke to Chris Palmer, a software security engineer who spent years working on security for Android and Chrome at Google, about what it's been like watching this game from the inside.

[1:54] Chris Palmer: A thing that I found was a lot of these bugs just keep recurring, and there's no good reason for that. We can solve this. We have the technology. Why aren't we solving this? A lot of weight was put on these exploit mitigations as, this is going to be the thing that saves us, and it consistently never works. And so there's like a denial stage of grief going on, right, where they're thinking, well, maybe the next exploit mitigation will solve the problem. Maybe we can fuzz our way out of this. Maybe we can find the bugs fast enough by whatever testing mechanism, and we never can. We've tried. We put a lot of money into it, and it never worked. The trouble is, historically, we've never been able to raise the cost beyond what attackers can pay. The only real way to do it is to make the bug fully go away. As we try things to either make a bug less useful once exploited, or not affordably exploitable, we also raise our own costs.

[3:03] Sarina Gandy: I put the same question to Alex Rebert, who leads work on safe coding at Google.

[3:10] Alex Rebert: A lot of people are pointing at the rise of exploitation costs. They are quite high. They probably wouldn't be as high without all of the work that was done, both in mitigating them, finding them, and patching them. What I don't understand, though, is, I would expect the rising costs, implying some kind of reduction in supply due to the difficulty of creating, finding those vulnerabilities and creating exploits. But that should be accompanied by a reduction in the percentage of vulnerabilities that are due to this issue. And that did not happen.

[3:48] Sarina Gandy: Natalie Silvanovich leads Project Zero, Google's team that hunts for flaws before attackers find them. She said this.

[3:55] Natalie Silvanovich: When I started in the industry, one bug would give you access to a phone, but it's not like that anymore. Mostly due to the work of the defenders who really cared about this issue and making it more difficult.

[4:10] Sarina Gandy: Natalie is right. Those defenses made attacks harder and more expensive. But they didn't make the bug go away, and the percentage of these vulnerabilities still hasn't changed.

4:21 The 70 percent problem

[4:21] Sarina Gandy: Around 2019 and 2020, a security engineer named Alex Gaynor started counting. He went through the security fixes for Chrome, Android, iPhones, Macs, Windows, and Linux. Each time, roughly two-thirds or more were memory safety bugs. He wrote:

[4:40] Alex Gaynor (written): I'm not aware of any counter-examples.

[4:43] Sarina Gandy: Dave Weston, the corporate vice president of AI enterprise security at Microsoft, also confirmed that for me.

[4:51] Dave Weston: The number, for as long as we've been tracking it, in general, memory safety has been around 70%. The reason is, like, the fundamentals haven't changed.

5:02 Rust, the fix that worked

[5:02] Sarina Gandy: In 2006, a software engineer named Graydon Hoare created a solution that actually did change the fundamentals. It's called Rust, and it's a memory-safe language. Graydon answered our questions in writing and said this:

[5:17] Graydon Hoare (written answer): Enough time passed for people to get tired of waiting for "safe C++ if we just try harder" to work. People believed it for a while, but you can only believe so long. The attackers are persistent and creative and only have to be right once.

[5:34] Sarina Gandy: Memory-safe languages aren't new. They've also existed for decades, and most of the code behind the websites you use runs in one. But for the deepest layers of software, the parts that have to be fast, the only real options for decades were memory-unsafe languages, C and C++. Rust was the first memory-safe language to offer the same speed and power, but without the bug. Rust inventor Graydon said:

[5:59] Graydon Hoare (written answer): Lots of languages are memory safe. It's not a particularly rare property. There was just a bit of an old split between "safe, and therefore too slow for some people's taste" and "unsafe and max speed." That split caused unnecessary grief.

[6:19] Sarina Gandy: Graydon started Rust as a side project in 2006. Mozilla, the organization behind the Firefox browser, backed it, and version 1.0 came out in 2015. Dave Weston has witnessed Rust's development over time.

[6:35] Dave Weston: Rust is kind of a unicorn in the sense that it's the only systems language I know of that still has the same performance and memory footprint of C and C++. We have really good evidence that we can change the dynamics here. The one I would call out is we basically eradicated the stack overflows that you were talking about in Aleph One, so-called static stack buffer overflows. And that's because we basically eradicated the parts of the language that could introduce that. And so in this place where we've been able to sort of systematically say, we're no longer going to allow this behavior, we've seen the cause and effect. And so that's been awesome.

7:22 What happened at Android

[7:22] Sarina Gandy: In 2019, Android began moving parts of its code to Rust. Shortly after, Lars Bergstrom began leading the Google teams responsible for the programming languages Android is built with. He had a front-row seat to what happened next.

[7:36] Lars Bergstrom: I joined the Android team after Mozilla. Actually, they had already been starting their transition to Rust, so they had already seen, you know, memory safety vulnerabilities, as with many other large software projects, amounted to around 70% of the critical security vulnerabilities that we saw in Android. And so the Android team had already been working for a couple of years on beginning their migration to Rust, and making sure that it was enabled and able to be used within the Android platform.

With Android's transition to Rust, it could not have been more successful at preventing memory safety vulnerabilities. So technically, there are backdoors in Rust called unsafe blocks, where there could be a memory safety vulnerability, and we believe that eventually there will be some. But in our process of rolling out millions of lines of Rust code, we did not find a single memory safety vulnerability.

And even worse, we had projections for millions of lines of code. We knew that there should be many hundreds of vulnerabilities had this been written in C++. We just had the data across the industry, across Android. It's very predictable, very reliable. The numbers still hold today. You know, and so we can say very concretely that we eliminated hundreds of memory safety vulnerabilities that otherwise would have made it all the way to consumers.

[9:00] Sarina Gandy: Every other fix made the attacks harder but didn't solve the root problem. This one, a memory-safe language, protected consumers from hundreds of vulnerabilities before they ever reach them.

9:12 Who pays

[9:12] Sarina Gandy: But when a company doesn't make that choice, those vulnerabilities do reach us. And too often, consumers are the ones who pay. Here's Doctor Watson.

[9:23] Robert Watson: The people who suffer from the problems of memory safety, you know, end users, consumers, businesses deploying things, they are not in a situation where they can individually invest to fix the problem, so they pay the costs.

[9:35] Sarina Gandy: Jake Braun worked on cybersecurity policy at the White House. Now he helps run DEF CON Franklin, where volunteer hackers help small water utilities defend themselves. In 2024, U.S. agencies warned that Chinese government hackers had been quietly getting into American water and power systems in a campaign called Volt Typhoon.

[9:56] Jake Braun: You know, when you're going to these water utility operators and you're like, oh, by the way, the stuff that all your code's written in is completely insecure, and, you know, you have no budget, you have no ability to buy cyber tools or hire cyber professionals. And on top of that, your infrastructure is just riddled with holes because it wasn't written in memory-safe languages. I mean, it has a massive impact on critical infrastructure, and that, you know, leaves doors open, figuratively and literally, for the Chinese to go in and put malware in these environments and so on. You know, memory-safe languages could have prevented some of, or at least made us find out faster.

[10:40] Sarina Gandy: Yael Grauer spent years at Consumer Reports helping people stay safe online, and she wrote its report on the future of memory safety.

[10:48] Yael Grauer: There's a lot of companies that are like, be aware that X, Y, Z bad things could happen. And I'm like, how is that helping anybody? I call it the burden economy. When they try to absolve themselves of responsibility for the real risks that their products or their software carries, they'll be like, oh, well, just tell people to be aware. And I'm like, you know, the people that you're putting the onus of responsibility on have the least amount of power, the least amount of knowledge, the least amount of data, time, money, like all of it.

[11:14] Sarina Gandy: In the last episode, we discussed these burdens falling on hospitals in England and a woman named Audrey waiting months for a critical scan. But it's also reaching our school districts, town water systems, and the small businesses we all love that can't afford an IT department.

11:31 Why not just switch?

[11:31] Sarina Gandy: Google could afford to switch. Most companies say they can't. Dan Wallach was a computer science professor at Rice University for almost 30 years, and until recently, he ran a DARPA program to translate old C code into Rust. He explained the problem like this.

[11:49] Dan Wallach: It's an economics problem. I have a given engineering budget, and I could spend all of my engineering budget on paying my engineers to rewrite old C and C++ to modern Rust. Or I could spend my engineering budget on new features that I need to sell my product. So what's it going to be? It would cost a trillion engineering dollars to translate a billion lines of code.

[12:16] Sarina Gandy: Here's Jake Braun again.

[12:18] Jake Braun: You've got all this old code that's written in C or C++. You know, doing a rip and replace in some cases, I don't know if it's even possible. In other cases, it would cost so much money or be so time-intensive or require a level of expertise that's just not present in a lot of these water utilities. That just becomes infeasible.

[12:40] Sarina Gandy: This isn't the first time Jake has heard this argument. In 2024, his office at the White House put out a report urging companies to move to memory-safe languages. Some of the people who run critical infrastructure had a reply.

[12:55] Jake Braun: And then there was the kind of, the "oh, easy for you to say" type of folks. Like, yeah, great. That's when you go make your next dating app. Go ahead and make a memory safe— We're dealing with real problems like, you know, nuclear weapons, you know, the power grid, water utilities, all these things. They're all just written in C or C++ or whatever. It's not as easy as you're describing. Vanishingly few universities are teaching memory-safe coding in their programming classes. I also don't know that most hiring managers are asking people if they understand how to use memory-safe programming. And so I think that there's some dots that need to be connected in this space if we're really going to be able to have the impact we want to have, where you've got people learning how to do this stuff at university and so on, hiring managers knowing to make sure that their coders know how to do this stuff, then policymakers and other folks who buy a lot of stuff writing this into their contracts.

[14:03] Sarina Gandy: Graydon Hoare, inventor of Rust, said:

[14:05] Graydon Hoare (written answer): Mozilla paid a fortune to build Rust and got little immediate reward. For most of a decade, it was an act of random public goodwill. Few companies will make such an investment.

[14:18] Sarina Gandy: This is Chris Palmer again.

[14:20] Chris Palmer: It's fair to say that browsers have the hardest security problem of anything. They have to read everything on the internet. Every web page, every video, every audio. Their job is to just take in everything, and they have to do it super fast. So efficiency becomes a big concern, and it pushes down safety. And C++ was the only plausible implementation language up until, like, 2013 or later. A perfect storm of huge risk. And memory safety is a huge part of that, because every avenue for trouble is open in a web browser, and you have to argue with your boss about making it safe but still fast enough. And your boss is under pressure from competitors publishing microbenchmarks showing that they can render a CSS gradient three nanoseconds faster. And if you put in a bounds check, now we lose the benchmark. And then you have to explain that. And C++ was our only tool. And it's a terrible tool.

[15:32] Sarina Gandy: A bounds check is a safety check. Before the program reads or writes memory, it makes sure that it's staying inside the lines. It costs a sliver of speed. Buyers can see speed. They can't see safety.

15:46 The case against

[15:46] Sarina Gandy: There are two objections I heard over and over when it comes to translating old, unsafe C code into memory-safe languages. The first: good programmers don't make these mistakes. The second: if you close this door, attackers will just find another one. When prompted about the argument that a skilled enough C programmer could have found the solution, Graydon responded:

[16:08] Graydon Hoare (written answer): I still hear it now. I answer it by asking them if they think skilled drivers shouldn't have to wear seatbelts and skilled surgeons shouldn't have to wash their hands. Or perhaps if skilled pilots should fly planes with no instruments. It isn't about skill.

[16:24] Sarina Gandy: Alex Gaynor took on the "just write better C++" argument back in 2019, in a post called "Modern C++ Won't Save Us." His conclusion:

[16:35] Alex Gaynor (written): At scale, it's simply not possible to hold C++ right.

[16:40] Sarina Gandy: The second objection is that translating memory-unsafe code won't matter because attackers will just find another way in. I put that to Dan Wallach.

[16:49] Dan Wallach: There is an argument that says that if we put all this energy into solving memory safety problems, then attackers will just find a different way of attacking your system. And, well, to some extent, yes, of course. No one ever claimed that memory safety is all of the world's security problems. We're saying that it's give or take two-thirds. If we can take those two-thirds of the vulnerabilities off the table, it forces the attacker to do other things that might be more expensive, more discoverable, more... more mitigated.

[17:27] Sarina Gandy: So what do the people who build C and C++ say? Google's Alex Rebert gave them their due when I asked if these languages could just be made safer.

[17:36] Alex Rebert: I mean, it is technically possible. The other way they could go is something like Rust, which has shown that you can provide those guarantees pretty cheaply, which is one of the big innovations that happened in the field. I'm really, really excited about some of the hardening work they did on preventing out-of-bounds vulnerabilities. I think that is a huge amount of progress and a big chunk of the issues that we're facing. But I think you require a willingness for the language community to evolve in that direction. And what we have seen is they have been resistant to some of the lifetime work, because they don't want to evolve language and direction. And some of the other direction that they are suggesting does not seem to address the full amount of issues. And so, I don't think it may be sufficient.

[18:24] Sarina Gandy: Even the strongest advocates of Rust, like Lars Bergstrom, says the C and C++ world has made real progress, and that some code will stay in C for a long time.

[18:35] Lars Bergstrom: I think the argument that it's impossible to transition from C++ to Rust at scale, you know, there is one area where it's still very challenging: very actively edited C++ code bases that are vibrant upstream. It's very hard to port a moving target, so I will absolutely give you that one. I think the challenges will still remain for very, very active C and C++ projects. How do we ensure that those remain safe, despite the fact that they're not written in a memory-safe language? And that'll be through some combination of increased quality tools, some of the great work that the C++ team is doing around safety profiles, as well as hardware mitigations that we build in order to have defense in depth.

19:22 CHERI: safety built into the chip

[19:22] Sarina Gandy: Rewriting software is one answer. Lars just mentioned another: hardware. For 15 years, Doctor Robert Watson of the University of Cambridge has worked on a way to build the protection into the computer chip itself.

[19:37] Robert Watson: I'll say the technology that we've built, CHERI, Capability Hardware Enhanced RISC Instructions, but mostly just CHERI to most people, including us, is a hardware technology, and it is intended to mitigate software vulnerabilities.

[19:49] Sarina Gandy: To see what that means, here's Doctor Watson on what's going on inside of a computer.

[19:55] Robert Watson: Underneath the hood of these contemporary computer systems, they're just numbers floating around. The numbers are sometimes the data that you're interested in, the picture of a cat, for example, right?

But sometimes those numbers are actually addresses. They're locations in memory where to find the data you're looking for.

They're called pointers. That's sort of the heart of most memory safety attacks, is attacks on these pointers.

You can replace the value of a pointer with something else. You can say, you know, I didn't mean the picture of the cat, I actually meant the executable code.

And what we do in CHERI is we protect those pointers. So we extend the hardware to know about pointers. Today, the hardware knows about numbers.

So the hardware knows if something is a pointer. And if you write a bunch of letters and numbers over it, because you went off the end of some string buffer and you replace a pointer with those, then it's not a pointer anymore.

We figured out a way to do it so that you can use your existing software. And that's very powerful, because it means it is a much more adoptable technology.

[20:41] Sarina Gandy: To see how it holds up, his team tried it on a real attack: BLASTPASS, a flaw that let attackers take over a phone with a single message containing a corrupted image. Citizen Lab found it being used against civil rights activists.

[20:54] Robert Watson: The vulnerability was discovered fielded against civil rights activists in the US by Citizen Lab. And it's called BLASTPASS, is the name of the vulnerability. Nation-state actors were using it for compromise of systems, and it was a buffer overflow, you know— impact to that kind of thing. You know, it was a zero day, which means the vendors got no advance warning. The CHERI version, without any change to the source code, mitigated the vulnerability completely.

[21:17] Sarina Gandy: It works with software that's already written. What it's waiting for is demand.

[21:22] Robert Watson: People only want to replace the hardware if they see the demand for it. Software developers have demonstrated the idea works on the software side. Oh, but, you know, the software developers, the hardware is three, five, ten years away. You know, product timelines are nine months. For many companies, it's cheaper to do nothing. You know, why would you go off and invest, you know, millions, billions of dollars upgrading these ecosystems when the cost is actually pretty low for— But ultimately, it's your customer who pays.

21:45 Why no one is asking for it

[21:45] Sarina Gandy: Doctor Watson said hardware won't change until someone demands it. So who's supposed to be demanding it? Here's Yael Grauer.

[21:53] Yael Grauer: Consumers weren't asking for this. They weren't saying, "I want my phone to be memory safe," because they had no idea what it was. I think if they knew, you know, your phone is built using code that is vulnerable to attacks— I feel like if people were aware of that, they would be asking for it.

[22:10] Sarina Gandy: David Rice, author of the book Geekonomics, said back in 2009 that two things have to be true before things change.

[22:17] David Rice (archival audio, 2009): There are two aspects to incentives that need to be in place from the software market for this game to change, and it's this: it should be more expensive to make and sell insecure software than to make and sell secure software. And buyers should have clear, observable, reliable signals to overcome the information asymmetry problem. They should know about the security of their product, and they should be able to visualize it and price it accordingly.

[22:40] Sarina Gandy: Doctor Watson has a clear picture of what that signal could look like.

[22:45] Robert Watson: What you want is a clear demand signal coming out of the customer base saying, actually, this memory safety stuff is really important to us. You would like to have the ability to ask for memory safety. You know, maybe if you deploy memory safety in your product, we're more likely to buy your product. You know, maybe we prefer to buy memory safety. Maybe we will only buy memory safety. Maybe if you use memory-safe technologies, then your professional indemnity insurance gets lower, right?

[23:08] Yael Grauer: It's hard to get people to be motivated by conscience, but they are motivated by money.

[23:13] Sarina Gandy: Governments are among the biggest buyers of technology, and so are whole industries like finance and health care. A buyer that big can change what everyone else sells. In February 2024, Jake Braun's office at the White House published the report I mentioned earlier. The idea was to move the burden of security off ordinary users and onto the companies that build our technology.

[23:37] Jake Braun: We had to shift the burden of security from the end user, so, like, my, you know, 15-year-old twins or my father, to the major companies that build all our tech, which, by, you know, estimates from Microsoft and others, could deal with 70% of known cyber vulnerabilities that— companies who write in memory-safe programming today. So we know it's doable and would have an outsized impact if it was actually implemented. And you're never going to make people really care about memory safety. What you can make people care about is what are the downstream effects of our code not being memory safe, right? Make them care about the solution— You need to make them care about the actual manifestation of the problem in the real world. It's like, can our society provide the very basic life-giving services, like water coming out of the tap? You know, the incentive structure is likely going to play out in a very long-term way, probably through courts, probably through the insurance market, and potentially through demand, when you can get products that are markedly better than other products.

[24:48] Sarina Gandy: When a buyer does want something, things can move quickly. Lars Bergstrom saw it happen inside Android, specifically within its automotive partners.

[24:57] Lars Bergstrom: Rust adoption, actually even in Android, sort of took off more in the automotive space than it did in the mobile space. Right? The automotive team saw what we were doing with Rust, and they were like, we need that immediately. And so they were off to the races. They didn't even talk to us about it. They just took the compilers and all of that. And then it turned out they had already been going out and talking to their ecosystem about it and adopting Rust.

[25:22] Sarina Gandy: Nobody had to ask for Android to move quickly. But the biggest buyers can ask. And when they do, companies listen.

25:31 The fine print

[25:31] Sarina Gandy: But most of us aren't the big buyers. We're the ones clicking "I agree" on software agreements we'll never understand. So I wanted to know, when you buy software and something goes wrong, what has the company actually promised you? The answer is in the fine print. Most software comes with a license, and most licenses include a line like this one: "The software is provided as is, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, yada yada yada." I asked cybersecurity law professor Jim Dempsey what sentences like this actually mean.

[26:10] Jim Dempsey: Nowadays, almost all software is licensed, not sold, but the [license] explicitly says, "This product is sold as is." And, meaning, we make no guarantee if it's going to work. And they explicitly say if it doesn't work, if something goes wrong with this product, we, the developer, face no liability. And you, in that contract and that license, have basically said, you've surrendered your right to sue. So, consider a toaster in your kitchen. If the toaster is poorly designed or poorly manufactured, and the toaster overheats and starts a fire and your kitchen burns, your house suffers damage, you can recover for that. You can sue the toaster maker. But if your computer figuratively fries your data, if your computer crashes, if your computer is vulnerable, if your computer is attacked by an adversary and you lose productivity, you have to spend time recovering, mitigating, restoring operations, you cannot recover against the software developer of the computer.

[27:31] Sarina Gandy: Geekonomics author David Rice made a similar point back in 2009.

[27:37] David Rice (archival audio, 2009): And the marginal cost is the cost of producing just one more copy of that patch. And it's almost near zero. Yet we insist that these downstream market participants patch, filter, and protect their systems while doing little to stop the flow of pollution that occurs upstream.

[28:00] Sarina Gandy: Rust inventor Graydon Hoare said that's what bothers him about the license. He wrote:

[28:04] Graydon Hoare (written answer): It's about public safety and public health, about aspiring to live in a world where software doesn't come with a blanket disclaimer that it's so unreliable, it's not even fit for merchantability or any given purpose. I want software engineering to have some standards of reliability and social responsibility.

[28:26] Sarina Gandy: If a toaster burns down your kitchen, the toaster company pays. If software lets someone into a hospital's network, the hospital pays, and so do the people in it. That's how it works today.

28:39 A company can choose

[28:39] Sarina Gandy: But it doesn't have to work that way. Every one of these is a decision someone made, and decisions can be made differently. At Android, someone decided to, and the results have spoken for themselves. Here's Natalie Silvanovich again.

[28:54] Natalie Silvanovich: Android is writing most of its new code in Rust to protect against memory corruption vulnerabilities. And this is a deliberate decision to protect against memory corruption vulnerabilities. We know that attackers use them, and that's a risk to users. So it is a very dedicated effort.

[29:12] Sarina Gandy: Android isn't the only one. Microsoft has also started moving to Rust as well as investing in its development. It's early, but the company has made its bet. For decades, a company could leave old code alone and hope that nobody found the flaws in it. Now that AI has entered the chat, simply waiting to see if attackers will find these bugs is getting riskier. Lars Bergstrom was at Android when that started to happen.

[29:39] Lars Bergstrom: The AI discovery of vulnerabilities was really terrifying to us. You know, I was at Android at the time when all of this stuff came out, and we were looking at it and we were analyzing the code. And, you know, not only can it find vulnerabilities in code, but it can find vulnerabilities in compiled code— a thing. But really, you know, again, to be optimistic, we got access to those models early. We had the opportunity to intervene in the ecosystem before the tools became widely deployed. And we had the opportunity to take that moment as an industry across all of Android and say, hey, sorry, gotta fix it all.

[30:20] Sarina Gandy: That head start let Android push fixes out faster, but attackers can use these tools too. And every day a flaw stays in the code is another day someone can find it.

I'll leave you today with this. In 2002, Windows was being exploited so often that people were telling each other not to use it. Bill Gates wrote a memo to the whole company, and by Dan Wallach's account, every developer stopped for about two months for security training.

[30:48] Dan Wallach: In particular, one line from Bill Gates' memo said, when we have a debate between adding a new feature versus making something more secure, security wins.

[31:02] Sarina Gandy: The reason this bug is still here isn't that nobody knows how to fix it. Google showed the fix works, and it chose to use it. Microsoft has started down the same road. But that's a handful of companies, out of thousands that write the software we all depend on. For the rest, fixing it costs the company, and not fixing it costs everyone else: the hospital, the school district, the water utility, the shop down the street, and me and you, every time we click "I agree."

That's not a flaw in the code. That's a decision about who pays. And if it's a decision, we're allowed to ask for a different one. Back in 2009, David Rice said nothing changes until it costs more to make and sell insecure software than secure software. Today, it doesn't. So what would make society decide that we shouldn't have memory-unsafe code in our software? What would make us decide that security wins?

Next time on The Bug We Let Live: what AI is doing to this bug, for attackers and defenders alike, and what it would take for everyone to choose the fix.

[32:22] Sarina Gandy: Thank you for listening to The Bug We Let Live. This audio documentary is a production of the Software Safety Institute, with generous support from Cyber Florida, produced by Sarina Gandy and co-produced by Rex Wilson. For more information, visit softwaresafety.org.