Memory-Safety Challenge Considered Solved? An Empirical Study with All Rust CVEs

03/06/2020
by   Hui Xu, et al.
0

Rust is an emerging programing language that aims at preventing memory-safety bugs without sacrificing much efficiency. The property is very attractive to developers, and many projects start using the language. However, can Rust achieve the memory-safety promise? This paper studies the question by surveying the bug reports collected from two public datasets, Advisory-db and Trophy-cases, which contain all existing CVEs (common vulnerability and exposures) of Rust. We manually analyze each bug and extract their memory-safety issues and culprits. Our results show that buffer overflow and dangling pointers are still the major memory-safety issues in Rust, and most culprits are related to unsafe Rust. Such security issues reveal that the security cost of Rust to support unsafe functions is high. To elaborate, the culprits of buffer overflow bugs in Rust are very similar to those in C/C++, which generally involve both logical errors and arbitrary pointer operations that are allowed only by unsafe Rust. However, the culprits of dangling pointers in Rust have unique patterns, especially those related to the vulnerability of Rust's borrow checker and lifetime checker. Based on these findings, we further suggest two directions to improve the resilience of Rust against dangling pointers, including recommending the best practice of some APIs to program developers, as well as approaches to enhancing the borrow checker and lifetime checker. Our work intends to raise more concerns regarding the memory-safety promise of Rust and facilitates the maturity of the language.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
05/06/2019

Charactering and Detecting CUDA Program Bugs

While CUDA has become a major parallel computing platform and programmin...
research
03/24/2021

CrossFix: Collaborative bug fixing by recommending similar bugs

Many automated program repair techniques have been proposed for fixing b...
research
05/06/2019

Characterizing and Detecting CUDA Program Bugs

While CUDA has become a major parallel computing platform and programmin...
research
03/21/2021

An Empirical Study of OSS-Fuzz Bugs

Continuous fuzzing is an increasingly popular technique for automated qu...
research
08/11/2021

The Forgotten Role of Search Queries in IR-based Bug Localization: An Empirical Study

Being light-weight and cost-effective, IR-based approaches for bug local...
research
10/31/2022

Unsafe's Betrayal: Abusing Unsafe Rust in Binary Reverse Engineering via Machine Learning

Memory-safety bugs introduce critical software-security issues. Rust pro...
research
08/09/2023

Is unsafe an Achilles' Heel? A Comprehensive Study of Safety Requirements in Unsafe Rust Programming

Rust is an emerging, strongly-typed programming language focusing on eff...

Please sign up or login with your details

Forgot password? Click here to reset