Google has summarized the use of Rust language components in the Android platform. The strategy to integrate safe development methods for new code in Android has proven successful. In 2025, the share of vulnerabilities caused by memory-related errors was below 20% of the total number of vulnerabilities for the first time. In comparison, this figure was 24% in 2024 and 76% in 2019. Meanwhile, the industry average remains at around 70%.

The use of Rust code in developing Android system components started in 2020. By 2025, the volume of new code in Rust for Android exceeded the yearly added code in C and C++.

Accumulated statistics confirm the previously stated hypothesis that new code is the primary source of security issues, while the security of old code shows an exponential dependence on time—errors in old code become less frequent over time. Ultimately, Google decided not to try rewriting old code in memory-safe languages, but to focus on using such languages for new code.
In addition to security, the implementation of Rust positively impacted the speed, productivity, and quality of development. For Rust code, there were four times fewer rollbacks due to unforeseen errors, along with a 25% reduction in review time.


When integrated into Android, changes of comparable size in Rust require about 20% fewer revisions than their C++ equivalents.

These indicators are attributed to simplified testing and shifting the detection of errors to earlier stages of development, where issues become noticeable before the developer begins code review. Furthermore, by eliminating overhead costs associated with sandbox isolation, Rust code has achieved improved performance.
Among the recent projects involving the use of Rust in Android, the first widely used driver written in Rust has been integrated into the Linux kernel 6.12, along with Rust being used for firmware and application development. In addition to the existing Rust driver in the kernel, a new GPU driver is being developed in collaboration with ARM and Collabora. Rust has also been implemented in the Nearby Presence protocol for detecting local devices via Bluetooth within Google Play Services. A new implementation of the MLS protocol, written in Rust, is planned for inclusion in the next release of the Google Messages app. The Chromium browser engine employs Rust-written parsers for web fonts, PNG images, and JSON format.
Currently, there are about 5 million lines of code in Android written in Rust, with just one potential vulnerability identified related to memory handling issues. Thus, the density of such vulnerabilities in Rust code is 0.2 vulnerabilities per million lines of code. In comparison, this figure is approximately 1000 vulnerabilities per million lines of code in C and C++ code. The key source of problems in Rust is the code found in unsafe blocks, which is estimated to account for 4% of all code written in Rust.
The mentioned vulnerability CVE-2025-48530 was found in the Crabby Avif library, which includes a parser and decoder for the Avif format. The issue was identified by Google employees before the release was published and did not affect users. The vulnerability was caused by an error in an unsafe block that led to a buffer overflow. It is noted that even if the error had gone unnoticed, its exploitation would have been blocked by the Scudo memory distribution system supplied with Android, which is enabled by default in firmware for Google Pixel and some other devices.
Source: opennet.ru
