Software Security with Rust

Most serious security vulnerabilities are often memory-safety bugs, and Rust eliminates them at compile time.

#The Problem: Memory Safety

The software industry has a serious memory-safety problem. Microsoft and Google both report that around 70% of the serious security vulnerabilities in their C and C++ code are caused by memory-safety bugs (see References).

3D pie chart: 69% of high and critical severity security bugs in stable Chromium are memory-safety bugs: use-after-free 36.1% and other memory unsafety 32.9%. Everything else is 31%.
Source: The Chromium Projects

#AI Raises the Stakes

With recent advances in AI-assisted code analysis and reverse-engineering tools — some of which are freely available online — vulnerabilities can be discovered and exploited more easily and faster than ever before. Cyber threats are likely to keep increasing in both frequency and intensity.

#Rust's Guarantees

Memory-safe languages can eliminate this class of vulnerabilities entirely. Rust, for example, enforces memory safety at compile time: if your code compiles, it is memory-safe, i.e., free of such bugs.

If you are starting a new software project, Rust deserves serious consideration.

If you want to harden an existing project, Rust can help there, too. In a larger codebase, you can write new modules in Rust and gradually rewrite selected existing ones. Your Rust modules can expose a C ABI, and the rest of the system can interact with them through FFI. The FFI boundary remains unsafe and needs special attention: keep it small, and review and test it carefully.

#References

Share

X LinkedIn