arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2308.15046cs.CRcs.SE
收藏

深入审视Rust生态系统中的安全风险

A Closer Look at the Security Risks in the Rust Ecosystem

Xiaoye Zheng, Zhiyuan Wan, Yun Zhang, Rui Chang, David Lo

AI总结:

该研究针对Rust生态安全风险研究不足的问题,构建涵盖433个漏洞、300个漏洞仓库及218个修复提交的7年跨度数据集,系统分析漏洞特征、漏洞包属性及漏洞修复规律。

摘要:

Rust是一种专为系统软件开发设计的新兴编程语言。为促进Rust代码复用,作为Rust生态系统中央包注册表的crates.io托管了数千个第三方Rust包。crates.io的开放性推动了Rust生态的发展,但也因严重的安全公告带来了安全风险。尽管Rust通过编程语言特性和严格的编译时检查保证软件程序的安全性,但Rust中的unsafe关键字允许开发者绕过特定代码区域的编译器安全检查。已有研究实证调查了Rust生态中的内存安全与并发漏洞,以及unsafe关键字的实际使用情况,但学界缺乏对Rust生态安全风险的系统性研究。\n 本文对Rust生态中存在的安全风险展开全面调查,围绕“漏洞有哪些特征、易受攻击的包有哪些特征、实践中漏洞如何被修复”这三个问题展开。为支撑本研究,我们首先构建了一个涵盖Rust生态中433个漏洞、300个存在漏洞的代码仓库、218个漏洞修复提交的数据集,时间跨度超过7年。基于该数据集,我们刻画了已披露漏洞的类型、存续周期及演化特征;随后分析了存在漏洞的Rust包的流行度、分类、漏洞密度,以及受已披露漏洞影响的版本和代码区域;最后,我们刻画了漏洞修复的复杂度及对应代码变更的局部性,并考察了从业者如何针对不同局部性的问题修复Rust包中的漏洞。

英文摘要:

Rust is an emerging programming language designed for the development of systems software. To facilitate the reuse of Rust code, crates.io, as a central package registry of the Rust ecosystem, hosts thousands of third-party Rust packages. The openness of crates.io enables the growth of the Rust ecosystem but comes with security risks by severe security advisories. Although Rust guarantees a software program to be safe via programming language features and strict compile-time checking, the unsafe keyword in Rust allows developers to bypass compiler safety checks for certain regions of code. Prior studies empirically investigate the memory safety and concurrency bugs in the Rust ecosystem, as well as the usage of unsafe keywords in practice. Nonetheless, the literature lacks a systematic investigation of the security risks in the Rust ecosystem. In this paper, we perform a comprehensive investigation into the security risks present in the Rust ecosystem, asking ``what are the characteristics of the vulnerabilities, what are the characteristics of the vulnerable packages, and how are the vulnerabilities fixed in practice?''. To facilitate the study, we first compile a dataset of 433 vulnerabilities, 300 vulnerable code repositories, and 218 vulnerability fix commits in the Rust ecosystem, spanning over 7 years. With the dataset, we characterize the types, life spans, and evolution of the disclosed vulnerabilities. We then characterize the popularity, categorization, and vulnerability density of the vulnerable Rust packages, as well as their versions and code regions affected by the disclosed vulnerabilities. Finally, we characterize the complexity of vulnerability fixes and localities of corresponding code changes, and inspect how practitioners fix vulnerabilities in Rust packages with various localities.

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

↑