The Illusion of Rust Safety: Detecting Modular Unsafe Functions with LLMs
Memory safety vulnerabilities account for approximately 70% of reported security bugs, prompting the adoption of Rust, a systems programming language designed to prevent such issues through compile-time checks. While Rust categorizes code into safe and unsafe regions, we identify a previously understudied class of vulnerabilities: modular unsafe functions (MUF) in Rust code. These functions appear safe to the compiler but are, in fact, unsafe within the whole module's APIs and can cause undefined behavior without using the unsafe keyword, leading to a misleading sense of safety and unsound issues in Rust. We present the first systematic study of mufs, defining five root cause categories from empirical analysis. We develop Coin, a detection system using fine-tuned large language models for vulnerability identification and proof-of-concept generation. Coin achieves 63.7% precision and 80.4% recall on labeled evaluation set, outperforming existing tools. On evaluation of 10,000 randomly sampled Rust crates, Coin identified 26 unknown mufs with 14 developer confirmations and 10 CVE assignments.
- Link
- https://www.semanticscholar.org/paper/786ff4de87b8bae8530fbc48a979ca5b75198495
- Found by
- Semantic Scholar
- Authors
- Xiang Cheng, Fan Sang, Yi-Bin Yang, Hang Zhang, Sangdon Park, Xiao-Kuan Zhang, Taesoo Kim
- Categories
- evaluation
- Published
- 2026-11-14
- Last seen by the radar
- 2026-11-15
- Citations
- 0
- Influential citations
- 0
- Radar score
- 31.60 / 100 (how it is scored)
- Why it scored so
- Matched: evaluat; Primary record: Semantic Scholar
- Related links
- https://doi.org/10.1145/3830454.3832709