Converting A C++ Codebase To Rust

 

How RunSafe Migrated a 30,000-Line C++ Codebase to Rust

Memory-safe languages like Rust are often recommended for new development — but rewriting large, security-critical C++ systems is rarely straightforward.

In this S4x25 session, Mitch Souders, Senior Software Engineer at RunSafe Security, shares how his team converted a 30,000-line C++ codebase to Rust to address memory-safety risks while preserving performance and behavior. Driven by the prevalence of memory-safety vulnerabilities and RunSafe’s secure-by-design principles, the project focused on eliminating entire classes of bugs rather than fixing them piecemeal.

Mitch walks through the technical realities of the migration, including operating without the Rust standard library, avoiding libc dependencies, handling global mutable state, and isolating unsafe Rust behind safe abstractions. He also covers the team’s testing and verification strategy, using comparative testing to ensure the Rust implementation matched the original C++ behavior byte for byte.

The result was a successful conversion with performance on par with C++, reduced binary size, and only about 1.5% of the codebase requiring unsafe Rust — along with the discovery of several latent bugs in the original C++ implementation.

This talk offers practical guidance for engineers responsible for legacy C++ codebases, security software, and ICS/OT environments who are evaluating Rust as a path to stronger memory safety.

How RunSafe Protects VxWorks Systems from URGENT/11 Exploits

How RunSafe Protects VxWorks Systems from URGENT/11 Exploits

Stopping URGENT/11 Attacks with RunSafe Protect In this demo, we show how RunSafe Protect defends VxWorks-based embedded systems from URGENT/11 memory safety exploits. You’ll see a vulnerable system challenged by a simulated attack and then observe how RunSafe’s...

read more
RunSafe Security in 2 Minutes: Protecting Critical Software

RunSafe Security in 2 Minutes: Protecting Critical Software

Inside RunSafe: A Quick Look at Our Mission, Platform, and Impact RunSafe Security is dedicated to protecting the world’s most critical software across defense, infrastructure, automotive, and medical systems. In this video, you’ll see how our platform delivers a...

read more