arXiv · 2211.00111
Ruby: Unmasking Unsafe Rust in Stripped Binaries via Machine Learning
Abstract
Rust, as an emerging system programming language, introduces $\texttt{unsafe}$ to allow developers to bypass safety checks during compilation. As a result, memory safety bugs are typically confined to the $\texttt{unsafe}$ regions, which have been the primary focus of Rust bug-finding tools. However, such tools rely on the presence of the $\texttt{unsafe}$ keyword in Rust source code; there are no tools available that can examine Rust binaries to pinpoint $\texttt{unsafe}$ areas. Therefore, we propose $\texttt{Ruby}$, the first tool that unmasks $\texttt{unsafe}$ regions in Rust binaries using machine learning. By capturing the subtle differences in the binary instructions, $\texttt{Ruby}$ can identify 91.75% of the total $\texttt{unsafe}$ regions with a false positive rate of 6.16%, beating SOTA LLM models including GPT-5.2, Claude-4.5 and Gemini-3. We further applied $\texttt{Ruby}$ to guide symbolic execution and fuzzing, showing a speed-up of 57.95% and 21.26%, with five bugs confirmed and patched by Google in Android library fuzzing.
Explore related subjects
Keep this discovery
Xiang Cheng, Sangdon Park, HyungSeok Han, Xiaokuan Zhang, Taesoo Kim. 2022-10-31. Ruby: Unmasking Unsafe Rust in Stripped Binaries via Machine Learning. https://arxiv.org/abs/2211.00111
Cite the original work for its findings. Save a collection to share your selection of sources.