• Home
  • Search
  • A Closer Look at the Security Risks in the Rust Ecosystem
  • Open Access IconOpen Access
  • Cite Icon14
  • https://doi.org/10.1145/3624738Copy DOI Icon

A Closer Look at the Security Risks in the Rust Ecosystem

Show More
  • Abstract
  • Literature Map
  • References
  • Citations
  • Similar Papers
Abstract

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 article, 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. We find that memory safety and concurrency issues account for nearly two thirds of the vulnerabilities in the Rust ecosystem. It takes over 2 years for the vulnerabilities to become publicly disclosed, and one-third of the vulnerabilities have no fixes committed before their disclosure. In terms of vulnerability density, we observe a continuous upward trend at the package level over time, but a decreasing trend at the code level since August 2020. In the vulnerable Rust packages, the vulnerable code tends to be localized at the file level, and contains statistically significantly more unsafe functions and blocks than the rest of the code. More popular packages tend to have more vulnerabilities, while the less popular packages suffer from vulnerabilities for more versions. The vulnerability fix commits tend to be localized to a limited number of lines of code. Developers tend to address vulnerable safe functions by adding safe functions or lines to them, vulnerable unsafe blocks by removing them, and vulnerable unsafe functions by modifying unsafe trait implementations. Based on our findings, we discuss implications, provide recommendations for software practitioners, and outline directions for future research.

Similar Papers
  • Research Article
  • Citations79

Learning from mistakes

  • Mar 01, 2008
  • ACM SIGPLAN Notices
  • Shan Lu +3
  • Research Article

Evaluating the Impact of Generative AI on Intelligent Programming Assistance and Code Quality.

  • Mar 19, 2025
  • Power System Technology
  • Magnus Chukwuebuka Ahuchogu
  • Research Article
  • Citations15

Self-Assessment Procedure XXIII

  • May 01, 1995
  • Communications of the ACM
  • Mitchell H Clifton
  • Research Article
  • Citations21

Early prediction for merged vs abandoned code changes in modern code reviews

  • Feb 01, 2022
  • Information and Software Technology
  • Khairul Islam +4
  • Journal Issue
  • Citations1

Proceedings Eighth International Workshop on Programming Language Approaches to Concurrency- and Communication-cEntric Software

  • Feb 10, 2016
  • Electronic Proceedings in Theoretical Computer Science
  • Simon J Gay +1
  • Journal Issue

Proceedings Tenth Workshop on Programming Language Approaches to Concurrency- and Communication-cEntric Software

  • Apr 08, 2017
  • Electronic Proceedings in Theoretical Computer Science
  • Vasco T Vasconcelos
  • Book Chapter

7 Formal description methods

  • Jan 01, 2012
  • Hartmut König
  • Book Chapter
  • Citations3

When Are OSS Developers More Likely to Introduce Vulnerable Code Changes? A Case Study

  • Jan 01, 2014
  • Amiangshu Bosu +4
  • Conference Article
  • Citations113

LEOPARD: Identifying Vulnerable Code for Vulnerability Assessment Through Program Metrics

  • May 01, 2019
  • Xiaoning Du +6
  • PDF
  • Research Article
  • Citations138

Leveraging rust types for modular specification and verification

  • Oct 10, 2019
  • Proceedings of the ACM on Programming Languages
  • Vytautas Astrauskas +3
  • Research Article
  • Citations7

Automated Security Testing in DevOps Environments Using AI and ML

  • Jun 29, 2024
  • International Journal for Research Publication and Seminar
  • Bipin Gajbhiye +2
  • Single Book
  • Citations8

Programming Languages

  • Oct 27, 2022
  • Norman Ramsey
  • Book Chapter

Afterword

  • Oct 27, 2022
  • Norman F Ramsey
  • Conference Article
  • Citations162

Secure virtual architecture

  • Oct 14, 2007
  • John Criswell +3
  • Research Article
  • Citations16

Language-integrated provenance

  • Sep 12, 2017
  • Science of Computer Programming
  • Stefan Fehrenbach +1
Cactus Communications logo

Copyright 2026 Cactus Communications. All rights reserved.