arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2505.02464cs.CR
收藏

针对不安全 Rust 代码的定向模糊测试:利用选择性插桩

Targeted Fuzzing for Unsafe Rust Code: Leveraging Selective Instrumentation

David Paaßen, Jens-Rene Giesen, Lucas Davi

AI总结:

本文提出首个利用选择性代码覆盖率反馈将模糊测试集中于不安全 Rust 代码的方法,通过扩展 Rust 编译器工具链自动识别不安全代码组件,在不增加性能开销的情况下显著提高漏洞发现效率。

摘要:

Rust 是一种很有前景的编程语言,专注于并发性、易用性和安全性。它被主要行业参与者用于生产代码,并得到了政府机构的推荐。Rust 通过利用所有权和借用概念,在设计上提供了强大的安全保证。然而,Rust 允许程序员编写不受严格 Rust 安全策略约束的不安全代码。实证研究表明,实践中的安全问题总是涉及用不安全 Rust 编写的代码。在本文中,我们提出了第一种利用选择性代码覆盖率反馈将模糊测试工作集中到不安全 Rust 代码上的方法。我们的方法显著提高了对 Rust 程序进行模糊测试的效率,并且在对目标进行模糊测试时不需要额外的计算资源。为了量化部分代码插桩的影响,我们通过扩展 Rust 编译器工具链的能力来实现我们的方法。我们提出了一种自动化方法来检测不安全代码组件和安全代码组件,以决定在运行模糊测试活动以查找 Rust 程序中的漏洞时,模糊测试器应重点关注程序的哪些部分。我们的方法与现有的模糊测试实现完全兼容,并且不需要复杂的手工工作,从而保持了现有的高易用性标准。通过专注于不安全代码,我们的实现使我们能够生成以统计显著性触发更多不安全代码位置的输入,因此能够在更短的时间内检测到潜在漏洞,同时在模糊测试本身期间不施加任何性能开销。

英文摘要:

Rust is a promising programming language that focuses on concurrency, usability, and security. It is used in production code by major industry players and got recommended by government bodies. Rust provides strong security guarantees achieved by design utilizing the concepts of ownership and borrowing. However, Rust allows programmers to write unsafe code which is not subject to the strict Rust security policy. Empirical studies show that security issues in practice always involve code written in unsafe Rust. In this paper, we present the first approach that utilizes selective code coverage feedback to focus the fuzzing efforts on unsafe Rust code. Our approach significantly improves the efficiency when fuzzing Rust programs and does not require additional computational resources while fuzz testing the target. To quantify the impact of partial code instrumentation, we implement our approach by extending the capabilities of the Rust compiler toolchain. We present an automated approach to detect unsafe and safe code components to decide which parts of the program a fuzzer should focus on when running a fuzzing campaign to find vulnerabilities in Rust programs. Our approach is fully compatible with existing fuzzing implementations and does not require complex manual work, thus retaining the existing high usability standard. Focusing on unsafe code, our implementation allows us to generate inputs that trigger more unsafe code locations with statistical significance and therefore is able to detect potential vulnerabilities in a shorter time span while imposing no performance overhead during fuzzing itself.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑