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

08/09/2023
by   Mohan Cui, et al.
0

Rust is an emerging, strongly-typed programming language focusing on efficiency and memory safety. With increasing projects adopting Rust, knowing how to use Unsafe Rust is crucial for Rust security. We observed that the description of safety requirements needs to be unified in Unsafe Rust programming. Current unsafe API documents in the standard library exhibited variations, including inconsistency and insufficiency. To enhance Rust security, we suggest unsafe API documents to list systematic descriptions of safety requirements for users to follow. In this paper, we conducted the first comprehensive empirical study on safety requirements across unsafe boundaries. We studied unsafe API documents in the standard library and defined 19 safety properties (SP). We then completed the data labeling on 416 unsafe APIs while analyzing their correlation to find interpretable results. To validate the practical usability and SP coverage, we categorized existing Rust CVEs until 2023-07-08 and performed a statistical analysis of std unsafe API usage toward the crates.io ecosystem. In addition, we conducted a user survey to gain insights into four aspects from experienced Rust programmers. We finally received 50 valid responses and confirmed our classification with statistical significance.

READ FULL TEXT

page 6

page 9

research
03/22/2021

Comprehensive Integration of API Usage Patterns

Nowadays, developers often reuse existing APIs to implement their progra...
research
07/10/2020

Zur Benutzbarkeit und Verwendung von API-Dokumentationen

A good documentation is essential for a good usability of (security) API...
research
04/25/2021

RULF: Rust Library Fuzzing via API Dependency Graph Traversal

Robustness is a key concern for Rust library development because Rust pr...
research
02/24/2021

Hero: On the Chaos When PATH Meets Modules

Ever since its first release in 2009, the Go programming language (Golan...
research
03/24/2023

Improving API Documentation Comprehensibility via Continuous Optimization and Multilingual SDK

Optimizing and maintaining up-to-date API documentation is a challenging...
research
03/06/2020

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

Rust is an emerging programing language that aims at preventing memory-s...

Please sign up or login with your details

Forgot password? Click here to reset