Secure by Design: Google’s Perspective on Memory Safety (2024)

Google’s Project Zero reports that memory safety vulnerabilities—security defects caused by subtle coding errors related to how a program accesses memory—have been "the standard for attacking software for the last few decades and it’s still how attackers are having success". Their analysis shows two thirds of 0-day exploits detected in the wild used memory corruption vulnerabilities. Despite substantial investments to improve memory-unsafe languages, those vulnerabilities continue to top the most commonly exploited vulnerability classes.

In this post, we share our perspective on memory safety in a comprehensive whitepaper. This paper delves into the data, challenges of tackling memory unsafety, and discusses possible approaches for achieving memory safety and their tradeoffs. We'll also highlight our commitments towards implementing several of the solutions outlined in the whitepaper, most recently with a $1,000,000 grant to the Rust Foundation, thereby advancing the development of a robust memory-safe ecosystem.

2022 marked the 50th anniversary of memory safety vulnerabilities. Since then, memory safety risks have grown more obvious. Like others', Google's internal vulnerability data and research show that memory safety bugs are widespread and one of the leading causes of vulnerabilities in memory-unsafe codebases. Those vulnerabilities endanger end users, our industry, and the broader society. We're encouraged to see governments also taking this issue seriously, as with the U.S. Office of the National Cyber Director publication of a paper on the topic last week.

By sharing our insights and experiences, we hope to inspire the broader community and industry to adopt memory-safe practices and technologies, ultimately making technology safer.

At Google, we have decades of experience addressing, at scale, large classes of vulnerabilities that were once similarly prevalent as memory safety issues. Our approach, which we call “Safe Coding”, treats vulnerability-prone coding constructs themselves as hazards (i.e., independently of, and in addition to, the vulnerability they might cause), and is centered around ensuring developers do not encounter such hazards during regular coding practice.

Based on this experience, we expect that high assurance memory safety can only be achieved via a Secure-by-Design approach centered around comprehensive adoption of languages with rigorous memory safety guarantees. As a consequence, we are considering a gradual transition towards memory-safe languages like Java, Go, and Rust.

Over the past decades, in addition to large Java and Go memory-safe codebases, Google has developed and accumulated hundreds of millions of lines of C++ code that is in active use and under active, ongoing development. This very large existing codebase results in significant challenges for a transition to memory safety:

  • We see no realistic path for an evolution of C++ into a language with rigorous memory safety guarantees that include temporal safety.

  • A large-scale rewrite of all existing C++ code into a different, memory-safe language appears very difficult and will likely remain impractical.

We consider it important to complement a transition to memory safe languages for new code and particularly at-risk components with safety improvements for existing C++ code, to the extent practicable. We believe that substantial improvements can be achieved through an incremental transition to a partially-memory-safe C++ language subset, augmented with hardware security features when available. For instance, see our work improving spatial safety in GCP's networking stack.

We are actively investing in many of the solutions outlined in our whitepaper and in our response to the US Federal Government’s RFI on Open Source Software Security.

  • Android has written several components in Rust over the last few years, leading to compelling security improvements. In Android’s Ultra-wideband (UWB) module, this has improved the security of the module while also reducing the memory usage and inter-procedural calls.

  • Chrome has started shipping some features in Rust; in one case, Chrome was able to move its QR code generator out of a sandbox by adopting a new memory-safe library written in Rust, leading to both better security and better performance.

  • Google recently announced a $1,000,000 grant to the Rust foundation to enhance interoperability with C++ code. This will facilitate incremental adoption of Rust in existing memory-unsafe code bases, which will be key to enabling even more new development to occur in a memory-safe language. Relatedly, we are also working on addressing cross-language attacks that can occur when mixing Rust and C++ in the same binary.

We know that memory safe languages will not address every security bug, but just as our efforts to eliminate XSS attacks through tooling showed, removing large classes of exploits both directly benefits consumers of software and allows us to move our focus to addressing further classes of security vulnerabilities.

To access the full whitepaper and learn more about Google's perspective on memory safety, visit https://research.google/pubs/secure-by-design-googles-perspective-on-memory-safety/

Secure by Design: Google’s Perspective on Memory Safety (2024)

FAQs

Are Google search results safe? ›

All searches on Google.com and in the Google app are encrypted by default, keeping your information safe from anyone trying to intercept this data.

How does Google protect your data? ›

We've designed our data centers with security in mind.

We custom-build servers exclusively for our data centers, never selling or distributing them externally. And our industry-leading security team works 24/7 around the globe making our facilities one of the safest places for your data to live.

What are memory-safe languages? ›

Microsoft estimated that 70% of CVEs in their products were rooted in memory safety issues. Google conducted a similar study and found that 90% of Android CVEs could be correlated to memory safety. Go, Python, Rust, and Java are excellent examples of memory-safe languages.

Can C++ be memory-safe? ›

Since memory safety bugs are often security issues, memory safe languages are more secure than languages that are not memory safe. Memory safe languages include Rust, Go, C#, Java, Swift, Python, and JavaScript. Languages that are not memory safe include C, C++, and assembly.

Are my Google searches being monitored? ›

Did you know that – unlike DuckDuckGo – when you search on Google, they keep your search history forever? That means they know every search you've ever done on Google. That alone is pretty scary, but it's just the shallow end of the very deep pool of data that they try to collect on people.

How do I make Google Search safe? ›

Change SafeSearch settings
  1. On your Android phone or tablet, open the Google app .
  2. At the top right, tap your profile picture or initial Settings. SafeSearch.
  3. Select Filter, Blur, or Off. At the top right, if you find a Lock , your SafeSearch setting is locked.

Does Google have advanced data protection? ›

Google's strongest security helps keep your private information safe. The Advanced Protection Program safeguards users with high visibility and sensitive information from targeted online attacks.

How strong is Google security? ›

Our cloud infrastructure protects data 24/7

From custom-designed data centers to private undersea cables that transfer data between continents, we operate one of the world's most secure and reliable cloud infrastructures. It's continuously monitored to protect your data and keep it available.

Does Google really protect your privacy? ›

We do not sell your personal information to anyone. Advertising makes it possible for us to offer our products at no charge, and it helps the sites and apps that partner with us fund their content. Your personal information is not for sale. We keep your data private at every point in the process of showing you ads.

What languages are not memory-safe? ›

The ONCD points out that C and C++ are very popular programming languages used in critical systems but are not memory safe.

What is the least secure language? ›

C is the most vulnerable open-source language, with 47 percent of all reported vulnerabilities.

Why are C and C++ not memory-safe? ›

However, C and C++ both allow arbitrary pointer arithmetic with direct memory addresses and no bounds checking. In 2019, Microsoft security engineers reported that around 70% of security vulnerabilities were caused by memory safety issues.

Is Python memory-safe? ›

Python provides memory safety by default, so low-level security vulnerabilities are rare and typically needs fixing the Python interpreter or standard library itself. Other sections with Python-specific advice include: Dealing with temp files. Creating Safe Processes.

What language is Rust written in? ›

The first Rust compiler was written in OCaml (and in fact it is one of the languages that influenced Rust). Only a couple of years later did a Rust compiler get written in rust itself. Both existed in parallel for a bit before the OCaml based compiler got deleted.

Why use Rust over Python? ›

Rust significantly outperforms Python regarding raw performance, thanks to its zero-cost abstractions and efficient code generation. Rust's emphasis on memory safety and low-level control makes it suitable for performance-critical applications where speed and efficiency are paramount.

What does Google do with search results data? ›

Information such as your location, past Search history, and Search settings all help us to ensure your results are what is most useful and relevant for you in that moment. We use your country and location to deliver content relevant for your area.

Should I turn on safe browsing in Google? ›

If you choose to turn on Enhanced Safe Browsing for your account, Enhanced Safe Browsing keeps you safe when you're signed in and improves your security in Google Chrome and Gmail. To help protect your account and data, Enhanced Safe Browsing for your account checks for risky: URLs. Downloads.

What does Google do with search results? ›

Indexing: Google analyzes the text, images, and video files on the page, and stores the information in the Google index, which is a large database. Serving search results: When a user searches on Google, Google returns information that's relevant to the user's query.

References

Top Articles
Latest Posts
Article information

Author: Madonna Wisozk

Last Updated:

Views: 5824

Rating: 4.8 / 5 (68 voted)

Reviews: 83% of readers found this page helpful

Author information

Name: Madonna Wisozk

Birthday: 2001-02-23

Address: 656 Gerhold Summit, Sidneyberg, FL 78179-2512

Phone: +6742282696652

Job: Customer Banking Liaison

Hobby: Flower arranging, Yo-yoing, Tai chi, Rowing, Macrame, Urban exploration, Knife making

Introduction: My name is Madonna Wisozk, I am a attractive, healthy, thoughtful, faithful, open, vivacious, zany person who loves writing and wants to share my knowledge and understanding with you.