How memory safety CVEs differ between Rust and C/C++
- Security
- Programming
- Rust
- C++
- Developer Tools
The post compares memory-safety CVEs in Rust and C or C++ and says the counts are not measuring the same thing. In Rust, a library can get a CVE when safe-looking API usage can reach undefined behavior because an internal `unsafe` block failed to uphold Rust’s safety contract. In C and C++, similar misuse is often dismissed as violating a documented precondition, so it never becomes a CVE even if the outcome is a null dereference, buffer overrun, or other memory error. The curl example in the post is there to show the gap in classification, not to claim Rust has no bugs or that C APIs cannot be hardened.
Do not use CVE totals to compare language security. Look at exploitability, bug class, and reporting norms, and expect Rust ecosystems to surface more issues as CVEs because they treat unsound APIs as security bugs earlier and more aggressively.
- kobzol.github.io
- Discuss on HN