Security Experts:

Connect with us

Hi, what are you looking for?

SecurityWeekSecurityWeek

Mobile & Wireless

Google Migrating Android to Memory-Safe Programming Languages

Google is seeing a significant decrease in memory safety issues in Android due to the progressive migration to memory-safe programming languages, such as Rust.

Google is seeing a significant decrease in memory safety issues in Android due to the progressive migration to memory-safe programming languages, such as Rust.

Between 2019 and 2022, the annual number of reported memory safety issues in Android has dropped from 223 to 85, due to an increase in the amount of memory-safe code entering the mobile platform, and the trend is expected to continue.

Memory safety bugs, Google notes, are typically the most severe type of vulnerabilities. In 2022, they accounted for 86% of the critical-severity flaws in Android and for 89% of the remotely exploitable issues.

“Over the past few years, memory safety vulnerabilities have accounted for 78% of confirmed exploited ‘in-the-wild’ vulnerabilities on Android devices,” the internet giant explains.

The company also points out that the decrease in severe vulnerabilities has led to an increase in lower-impact issues, such as denial-of-service (DoS) flaws.

With most of the new code added to Android 13 being written in a memory-safe language, memory safety issues no longer represent the majority of vulnerabilities in the operating system, Google says.

“While correlation doesn’t necessarily mean causation, it’s interesting to note that the percent of vulnerabilities caused by memory safety issues seems to correlate rather closely with the development language that’s used for new code,” Google notes.

Support for Rust was introduced in Android 12, with the purpose of shifting development to a memory-safe programming language rather than converting existing C/C++ code to Rust.

“In Android 13, about 21% of all new native code (C/C++/Rust) is in Rust. To date, there have been zero memory safety vulnerabilities discovered in Android’s Rust code,” Google says.

The internet giant has also invested in improving the memory safety of C/C++ and says it has seen very few memory safety issues in Java, which uses the Java Native Interface (JNI) interface programming framework to access low-level resources. Most of the APIs in Android are implemented in Java.

The goal is to use Rust anywhere where native code is required, including kernel (due to support for Rust in Linux 6.1).

“Using Rust in Android allows us to optimize both security and system health with fewer compromises” to performance and security, Google says.

“As Android migrates away from C/C++ to Java/Kotlin/Rust, we expect the number of memory safety vulnerabilities to continue to fall,” the internet giant continues.

Related: NSA Publishes Guidance on Mitigating Software Memory Safety Issues

Related: Google Details Memory-Related Security Improvements in Android 11

Related: Google Working on Improving Memory Safety in Chrome

Written By

Ionut Arghire is an international correspondent for SecurityWeek.

Click to comment

Expert Insights

Related Content

Cloud Security

VMware vRealize Log Insight vulnerability allows an unauthenticated attacker to take full control of a target system.

IoT Security

Lexmark warns of a remote code execution (RCE) vulnerability impacting over 120 printer models, for which PoC code has been published.

Mobile & Wireless

Apple rolled out iOS 16.3 and macOS Ventura 13.2 to cover serious security vulnerabilities.

Email Security

Microsoft is urging customers to install the latest Exchange Server updates and harden their environments to prevent malicious attacks.

Mobile & Wireless

Technical details published for an Arm Mali GPU flaw leading to arbitrary kernel code execution and root on Pixel 6.

Application Security

Drupal released updates that resolve four vulnerabilities in Drupal core and three plugins.

Vulnerabilities

Security researchers have observed an uptick in attacks targeting CVE-2021-35394, an RCE vulnerability in Realtek Jungle SDK.

Vulnerabilities

Google has awarded more than $25,000 to the researchers who reported the vulnerabilities patched with the release of the latest Chrome update.