Skip to content
ContentLora

    Tip: press / anywhere to search.

    Explainer

    Memory-safe languages explained: the push to move beyond C and C++

    Memory safety bugs are flaws in how a program reads, writes or frees memory, and agencies call them the most common type of disclosed software vulnerability.[1][2] Since December 2023, US and allied cybersecurity agencies have urged software makers to publish roadmaps for moving to memory-safe languages such as Rust, Go, Java, C#, Python and Swift, away from C and C++.[3][4][5] The agencies acknowledge the move will take years and significant investment.[6]

    Editor reviewedUpdated Explainer15 claims · 100% primaryCybersecurity, Post-quantum cryptography and security, Computing
    Reading level: 5 passages differ; the rest is the same for everyone.

    This page describes government guidance and company-reported data; it does not compare individual languages or products. It sits near the end of the cryptography crash course, after side-channel attacks. Choose a reading level in each section.

    What memory safety bugs are

    A memory safety bug happens when a program reads, writes, sets aside or frees memory in ways it should not.[1]

    There are two broad kinds. Spatial bugs reach outside the space set aside for a piece of data. Temporal bugs use memory at the wrong time, for example after it has been freed.[7] The agencies say malicious actors routinely exploit these errors.[1]

    Memory safety vulnerabilities concern memory accessed, written, allocated or deallocated in unintended ways.[1] The 2024 ONCD report splits them into spatial violations (out-of-bounds access) and temporal violations (access outside an object’s lifetime, such as use after free).[7]

    How common they are

    In their December 2023 guidance, CISA, the NSA, the FBI and allied agencies called memory safety bugs the most common type of disclosed software vulnerability.[3][2] They cite about 70 percent of Microsoft’s security vulnerabilities from 2006 to 2018, and 67 percent of the zero-day flaws Google’s Project Zero analysed in 2021.[2]

    The Chromium project says about 70% of its high-severity security bugs are memory problems, and half of those are use-after-free bugs.[8]

    The joint guidance cites ~70% of Microsoft CVEs (2006-2018) and 67% of 2021 zero-days in Project Zero’s analysis.[2] Chromium reports ~70% of high-severity security bugs as memory unsafety, half of them use-after-free.[8]

    The government push

    The agencies call programming languages such as C and C++ memory-unsafe, and note they are still among the most widely used languages.[5] The agencies say memory-safe languages can eliminate memory safety vulnerabilities.[9] Their examples are C#, Go, Java, Python, Rust and Swift.[4]

    The December 2023 guidance, “The Case for Memory Safe Roadmaps”, came from cybersecurity agencies in the US, Australia, Canada, the UK and New Zealand. It urges software makers to publish roadmaps for the switch, signed by the CEO or another business executive.[3] In February 2024 the White House Office of the National Cyber Director (ONCD) called the programming language the highest-leverage place to reduce these bugs.[10]

    The joint guidance (CISA, NSA, FBI and the cybersecurity authorities of Australia, Canada, the UK and New Zealand) recommends evaluating several MSLs. Its appendix covers C#, Go, Java, Python, Rust and Swift.[4][3] It says MSLs can eliminate the vulnerability class, while the ONCD report says they eliminate most memory safety errors.[9] ONCD’s “Back to the Building Blocks” says securing the programming language is the highest-leverage way to reduce memory safety vulnerabilities.[10] For space systems it identifies an edge case: C and C++ remain the most widely used languages meeting space systems’ requirements, and Rust meets them but had not yet been proven in space. It points to memory-safe hardware and formal methods as complements.[11]

    Costs and limits

    The agencies acknowledge that the switch needs significant investment and executive attention, and careful planning over years. Most developers will keep mixing safe and unsafe languages for the foreseeable future.[6]

    Memory-safe languages are not a cure-all. Rust lets programmers switch off its safety checks with an “unsafe” keyword, and changing languages will not by itself stop cybercrime or espionage.[12] The ONCD report says no language eliminates every cybersecurity risk.[10] There are also efforts to make existing C and C++ code less vulnerable instead of rewriting it.[12]

    The guidance anticipates a multi-year transition with hybrid codebases, since MSL code will keep calling C and C++ libraries.[6] It notes Rust’s unsafe keyword can defeat language guarantees, that MSL adoption will not by itself deter cybercrime or espionage, and that targeted efforts aim to harden existing C and C++ code.[12] ONCD likewise says an MSL cannot eliminate every cybersecurity risk.[10]

    What the evidence shows so far

    Google reports that memory safety issues fell from 76% of Android’s vulnerabilities in 2019 to 24% in 2024, after its Android team began writing new code in memory-safe languages around 2019. These are Google’s own figures.[13] Google argues that most bugs live in new code, so writing new code safely cuts risk even while most older code stays in unsafe languages.[14]

    As of November 2026, the Linux kernel’s official documentation has a section on using Rust in the kernel.[15]

    Google’s September 2024 data: memory safety issues fell from 76% of Android vulnerabilities in 2019 to 24% in 2024, below what it calls a 70% industry norm. This followed prioritising MSLs for new development from around 2019.[13] Google attributes the decline to vulnerabilities concentrating in new code and decaying with code age. That interpretation is the company’s own, from its own codebase.[14] The Linux kernel documentation includes Rust support material as of November 2026.[15]

    Next in the crash course

    End-to-end encryption (E2EE) explained

    End-to-end encryption keeps messages readable only on senders' and recipients' devices. How Signal-style protocols, group chats, iCloud and Messenger use it.

    More in Cybersecurity

    Developing in AI & Computing

    Questions readers ask

    What is a memory-safe language?

    A programming language designed so that whole classes of memory errors cannot happen in ordinary code. CISA and its partners give C#, Go, Java, Python, Rust and Swift as examples, and say such languages can eliminate memory safety vulnerabilities.[4][9]

    Why are C and C++ considered unsafe?

    CISA and its partners call them memory-unsafe languages that can lead to memory-unsafe code, and note they are still among the most widely used languages.[5]

    How common are memory safety bugs?

    The agencies cite about 70 percent of Microsoft's CVEs from 2006 to 2018 and 67 percent of zero-days in 2021 by Google Project Zero's count. The Chromium project says about 70% of its high-severity security bugs are memory unsafety problems.[2][8]

    Does switching to Rust make software secure?

    No. The guidance notes Rust code can switch off its checks with the unsafe keyword, and says changing languages will not by itself stop cybercrime or espionage. The ONCD report says no language eliminates every cybersecurity risk.[12][10]

    Has moving to memory-safe languages worked anywhere?

    Google reported that memory safety issues fell from 76% of Android vulnerabilities in 2019 to 24% in 2024 after it began writing new code in memory-safe languages. These are Google's own figures.[13]

    Sources

    · 15 claims from 5 publishers

    Each numbered claim is a statement we checked against the sources listed with it. Tap a number in the text to see its sources in place.

    1. [1]

      US agencies define memory safety vulnerabilities as a class of flaws affecting how memory can be accessed, written, allocated or deallocated in unintended ways, and say malicious actors routinely exploit them. confirmedas of 2024-02-26

    2. [2]

      CISA and its partner agencies call memory safety vulnerabilities the most prevalent type of disclosed software vulnerability, citing about 70 percent of Microsoft CVEs (2006-2018) and 67 percent of zero-days in 2021 by Google Project Zero's analysis. confirmedas of 2023-12-06

    3. [3]

      The December 2023 guidance "The Case for Memory Safe Roadmaps", written by CISA, the NSA, the FBI and the cybersecurity authorities of Australia, Canada, the UK and New Zealand, urges software makers to write and publish memory safe roadmaps, signed by the CEO or another business executive. confirmedas of 2023-12-06

    4. [4]

      The agencies' guidance gives C#, Go, Java, Python, Rust and Swift as examples of memory-safe languages and recommends evaluating several before choosing. confirmedas of 2023-12-06

    5. [5]

      CISA and its partners name C and C++ as memory-unsafe languages that are still among the most widely used today. confirmedas of 2023-12-06

    6. [6]

      The agencies acknowledge that moving to memory-safe languages will need significant investment and executive attention and careful planning over years, and that most developers will work in a hybrid of safe and unsafe languages for the foreseeable future, since memory-safe code will still rely on C and C++ libraries. confirmedas of 2023-12-06

    7. [7]

      The White House Office of the National Cyber Director's 2024 report splits memory safety bugs into spatial ones (accessing memory outside an object's bounds) and temporal ones (accessing memory at the wrong time, such as after it is freed). confirmedas of 2024-02-26

    8. [8]

      The Chromium project says around 70% of its high-severity security bugs are memory unsafety problems, and half of those are use-after-free bugs. confirmedas of 2026-11-22

      • Memory safety · The Chromium Projects · Primary source · Memory safety page, opening (retrieved 2026-11-22)
      • Memory safety · The Chromium Projects · Primary source · Memory safety page, opening (retrieved 2026-11-22)
    9. [9]

      CISA and its partners say memory-safe languages can eliminate memory safety vulnerabilities; the ONCD report says they can eliminate most memory safety errors. confirmedas of 2024-02-26

    10. [10]

      In its February 2024 report "Back to the Building Blocks", the White House Office of the National Cyber Director called the programming language the highest-leverage place to reduce memory safety vulnerabilities, while saying no language eliminates every cybersecurity risk. confirmedas of 2024-02-26

    11. [11]

      The ONCD report says space systems are an edge case where C and C++ remain the most widely used languages meeting their requirements, and that Rust has those properties but had not yet been proven in space systems; it points to memory-safe hardware and formal methods as complements. confirmedas of 2024-02-26

    12. [12]

      The guidance notes that Rust code can opt out of its protections with the "unsafe" keyword, that switching languages will not by itself stop cybercrime or espionage, and that efforts are under way to make existing C and C++ code less vulnerable. confirmedas of 2023-12-06

    13. [13]

      Google reported in September 2024 that memory safety issues fell from 76% of Android vulnerabilities in 2019 to 24% in 2024 after the Android team began shifting new development to memory-safe languages around 2019. confirmedas of 2024-09-25

    14. [14]

      Google argues that vulnerabilities concentrate in new code and decay over time, so writing new code in memory-safe languages reduces risk even while most existing code stays in unsafe languages. reportedas of 2024-09-25· interpretation

    15. [15]

      As of November 2026, the Linux kernel's official documentation includes a section on using Rust within the kernel, with a quick-start guide. confirmedas of 2026-11-22

    Revision history (1)
    1. Page created.

    Created Nov 22, 2026. Last reviewed by an editor on Nov 22, 2026. Next scheduled review: May 24, 2027.

    Cite this page

    "Memory-safe languages explained: the push to move beyond C and C++." ContentLora, updated Nov 22, 2026. https://contentlora.com/explain/memory-safe-languages-explained

    Spotted an error? Suggest a correction or emailcorrections@contentlora.com.