TL;DR

Cargo-Geiger is a Rust cargo plugin that reports statistics on unsafe code usage in crates and dependencies. It aims to aid security audits but does not assess code security directly. The tool is now available via pre-built binaries and installation options.

Rust developers now have access to Cargo-Geiger, a tool that analyzes the usage of unsafe code within Rust crates and their dependencies, providing statistical insights to aid security audits. The tool is publicly available via pre-built binaries and installation instructions, marking a new resource for Rust security practices.

Cargo-Geiger is a cargo plugin designed to scan Rust projects for unsafe code usage across crates and dependencies. It originated from codebases like cargo-osha and cargo-tree, and can be installed either system-wide or with embedded OpenSSL support. The tool outputs statistical reports, helping developers gauge the prevalence of unsafe code in their projects, which is valuable for auditing and security assessments.

The tool is not intended to determine if code is ultimately secure or insecure but provides data to support informed decisions. It exposes three libraries: cargo-geiger, cargo-geiger-serde, and geiger, which are used internally and for reporting. The project’s maintainers note that unsafe code, while sometimes necessary, should be contained and used judiciously, similar to ionizing radiation, hence the name Geiger.

Implications for Rust Security and Development

Cargo-Geiger offers a new way for Rust developers and security auditors to quantify unsafe code use within projects, which is often a concern in Rust security discussions. By providing statistical insights, it helps teams identify dependencies with high unsafe code usage, potentially guiding safer code practices and audits. While it does not assess code security directly, it fills a gap in tooling for monitoring unsafe code prevalence, contributing to more transparent security assessments in Rust development.

Rust unsafe code analysis tool

Amazon

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Background on Unsafe Code in Rust and Tool Development

Rust is designed to promote safe programming, but unsafe code blocks are sometimes necessary for performance or low-level operations. Prior to Cargo-Geiger, developers relied on manual audits or ad hoc tools to estimate unsafe code usage. Existing tools like cargo-osha and cargo-tree provided some insights, but Cargo-Geiger consolidates and extends this functionality specifically for unsafe code statistics. Its release reflects ongoing efforts to improve security tooling within the Rust ecosystem, especially as projects grow more complex and dependencies increase.

“Cargo-Geiger provides valuable statistical data, but it’s not meant to judge code security directly.”

— an anonymous researcher

Limitations and Unanswered Questions About Cargo-Geiger

It is not yet clear how accurately Cargo-Geiger measures unsafe code in complex dependency trees or how developers will integrate its reports into broader security workflows. The tool’s effectiveness in real-world security assessments remains to be validated through user feedback and case studies. Additionally, the extent to which it can influence safer coding practices is still uncertain, as it provides statistical data without direct security evaluation.

Next Steps for Adoption and Community Feedback

Developers and security teams are expected to adopt Cargo-Geiger for ongoing projects and provide feedback on its usability and accuracy. Future updates may include enhanced reporting features, integration with other security tools, and validation studies. Monitoring its adoption will help determine its impact on Rust security practices and whether it becomes a standard part of Rust project audits.

Key Questions

What does Cargo-Geiger analyze?

It analyzes the usage of unsafe code in Rust crates and their dependencies, providing statistical reports on unsafe code prevalence.

Is Cargo-Geiger a security assessment tool?

No, it provides statistical insights but does not evaluate whether code is secure or insecure.

How can I install Cargo-Geiger?

You can install it via cargo with the command cargo install --locked cargo-geiger. For vendored OpenSSL support, use cargo install --locked cargo-geiger --features vendored-openssl. Pre-built binaries are also available from GitHub releases.

Will Cargo-Geiger tell me if my code is safe?

No, it only reports the amount of unsafe code used, not its safety or security implications.

What are the future plans for Cargo-Geiger?

Future development may include improved reporting, integration with other security tools, and community feedback to refine its features.

Source: Hacker News


You May Also Like

Japan defense forces used USB drives with China-linked virus: Nikkei investigation

Nikkei investigation reveals Japan’s Self-Defense Forces used infected USB drives linked to Chinese hackers for nearly a year without disclosure.

TFTP Honey Pot Results

Analysis of recent TFTP honey pot data uncovers active scanning and exploitation attempts, highlighting persistent vulnerabilities in network security.

CVE-2026-25089: Fortinet FortiSandbox OS Command Injection Vulnerability Actively Exploited (CISA KEV)

A critical OS command injection flaw in Fortinet FortiSandbox is actively exploited, posing risks to affected networks. Details are emerging.

What xAI’s Grok Build CLI Sends To xAI: A Wire-level Analysis

A detailed examination of what data xAI’s Grok build CLI transmits to xAI servers, revealing the underlying communication protocols and data types involved.