Memory safety methods significantly reduced the number of vulnerabilities in Android

Google has summarized the results of its initiative to implement safe development methods in Android, such as the use of programming languages that ensure safe memory management, the application of static analyzers, and the design of APIs with security in mind. These changes have reduced memory-related vulnerabilities in Android from 76% in 2019 to 24% in 2024, significantly lower than the industry average of 70%.

Google engineers also concluded that the main source of security problems is new code, and therefore attention should be focused on modernizing the methods for developing new code. Existing code gradually becomes more vetted and secure (there is an exponential dependence of security on time), making investments in rewriting existing code less advantageous. For example, 5-year-old code on average has a vulnerability density 3.4 times lower than that of new code. For Android and Chromium projects, the implementation of safe memory practices results in a difference of 7.4 times.

Memory safety methods significantly reduced the number of vulnerabilities in Android

Thus, if memory errors in new code are prevented, similar errors in old code will be identified less and less over time. In general, Google recommends not rewriting old code but focusing on writing new code in languages that safely manage memory and ensuring interoperability between new and old code.

In addition to reducing the number of vulnerabilities, the use of safe programming methods improves development productivity, leads to higher code quality, and positively impacts performance. For example, rewriting QR code generation code in Chromium using Rust has resulted in a 95% performance increase by eliminating overhead associated with the need for additional sandbox isolation.

The speed and quality of development improve due to simplified testing and the early detection of errors, which become apparent before the developer begins code review. For example, the rollback rates show that for Rust code, the number of rollbacks due to unforeseen errors is twice as low as that for C++ code.

In general, the application of secure programming methods is presented as the most effective development paradigm today, replacing the three approaches previously used:

  • Fixing vulnerabilities after they are discovered. This is costly, requires frequent updates, and necessitates swift dissemination to users.
  • Proactive protection focused on applying techniques that complicate the exploitation of vulnerabilities. The cost of such protection was reduced performance and a constant game of cat-and-mouse with attackers.
  • Early detection of vulnerabilities through fuzzing testing and tools like AddressSanitizer and MemorySanitizer. This method merely addressed the symptoms rather than the root cause and required ongoing work.

Memory safety methods significantly reduced the number of vulnerabilities in Android
Memory safety methods significantly reduced the number of vulnerabilities in Android


Source: opennet.ru
Buy reliable website hosting with DDoS protection, VPS VDS servers 🔥 Buy reliable website hosting with DDoS protection, VPS VDS servers | ProHoster