Google: Decline in Android Memory Safety Vulnerabilities Linked to Rust Use

According to Google Security News, memory safety vulnerabilities have consistently accounted for more than 65% of vulnerabilities across products and across the industry for more than a decade. Recently, however, on Android, memory safety vulnerabilities have decreased significantly, and the severity of the associated vulnerabilities has also decreased.

“From 2019 to 2022, the annual number of memory safety vulnerabilities dropped from 223 to 85,” Android security engineer Jeffrey Vander Stoep said in a blog post. Jeffrey said this decline coincides with efforts to abandon memory-unsafe programming languages, where “memory-unsafe programming languages” refers to C/C++.

Starting with Android 12 last year, Rust has become the Android platform language. Now in Android 13, most of the new code added to the version is written in memory-safe languages ​​— Rust, Java, or Kotlin — Jeffrey said.

As Android memory-unsafe code becomes less and less, memory safety vulnerabilities will decrease from 76% of Android vulnerabilities in 2019 to 35% in 2022. 2022 will be the first year that memory safety vulnerabilities will no longer represent the majority of vulnerabilities in Android.

“While correlation does not necessarily imply causation, it is worth noting that the percentage of vulnerabilities caused by memory safety issues seems to be strongly correlated with the development language used for new code,” Jeffrey said.

It is reported that in Android 13, about 21% of the new native code (C/C++/Rust) is Rust. Approximately 1.5 million lines of Rust code in AOSP, covering various new features and components such as Keystore2, a new Ultra Wideband (UWB) stack, DNS-over-HTTP3, Android’s Virtualization Framework (AVF), and various other components and its open source dependencies. These are low-level components that require a system language that would otherwise be implemented in C++. To date, zero memory safety vulnerabilities have been found in Android’s Rust code.

However, Jeffrey also said that Google’s goal is not to convert existing C/C++ to Rust, but to shift the development of new code to a memory-safe language over time.

Google isn’t the only big tech company recognizing the benefits of memory-safe code. The Meta layer expressed its appreciation for Rust. A few months ago, Microsoft CTO Mark Russinovich announced that C/C++ should no longer be used to start new projects, saying that Rust should be deployed wherever a language without garbage collection is required.

Reference link:

The text and pictures in this article are from InfoQ

loading.gif

This article is transferred from https://www.techug.com/post/google-the-decline-of-android-memory-security-vulnerabilities-is-related-to-the-use-of-rusea1ce16954248f4b65c9/
This site is only for collection, and the copyright belongs to the original author.