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

10/31/2022
by   Sangdon Park, et al.
0

Memory-safety bugs introduce critical software-security issues. Rust provides memory-safe mechanisms to avoid memory-safety bugs in programming, while still allowing unsafe escape hatches via unsafe code. However, the unsafe code that enhances the usability of Rust provides clear spots for finding memory-safety bugs in Rust source code. In this paper, we claim that these unsafe spots can still be identifiable in Rust binary code via machine learning and be leveraged for finding memory-safety bugs. To support our claim, we propose the tool textttrustspot, that enables reverse engineering to learn an unsafe classifier that proposes a list of functions in Rust binaries for downstream analysis. We empirically show that the function proposals by textttrustspot can recall 92.92% of memory-safety bugs, while it covers only 16.79% of the entire binary code. As an application, we demonstrate that the function proposals are used in targeted fuzzing on Rust packages, which contribute to reducing the fuzzing time compared to non-targeted fuzzing.

READ FULL TEXT

page 1

page 23

research
08/27/2022

Fat Pointers for Temporal Memory Safety of C

Temporal memory safety bugs, especially use-after-free and double free b...
research
12/01/2021

Common Bugs in Scratch Programs

Bugs in Scratch programs can spoil the fun and inhibit learning success....
research
04/20/2023

Leveraging Static Analysis for Bug Repair

We propose a method combining machine learning with a static analysis to...
research
08/19/2021

MESH: A Memory-Efficient Safe Heap for C/C++

While memory corruption bugs stemming from the use of unsafe programming...
research
10/04/2022

NeuDep: Neural Binary Memory Dependence Analysis

Determining whether multiple instructions can access the same memory loc...
research
05/08/2023

Modelling Concurrency Bugs Using Machine Learning

Artificial Intelligence has gained a lot of traction in the recent years...
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