Compromised Rust Crate onering Steals Source Code During Application Builds

A major software supply chain attack has struck the Rust ecosystem after threat actors hijacked widely used crates and embedded a malicious build-time dependency that can steal source code, browser credentials, and cryptocurrency wallet data during application compilation.

The incident affected arrayref version 0.3.10, append-only-vec version 0.1.9, and internment version 0.8.7.

Together, the packages have accumulated hundreds of millions of downloads, making the campaign one of the largest known Rust crate compromises in terms of potential downstream exposure.

Compromised Rust Crate onering Steals Source Code

Researchers at Aikido Security initially identified a suspicious new crate named proc-macro1.

The package impersonated proc-macro2, a heavily used Rust dependency, by copying its description and documentation. Its similarity to the legitimate package was intended to lower suspicion among developers and automated dependency-review processes.

Within approximately one hour of the typosquat’s publication, the compromised arrayref and append-only-vec releases added proc-macro1 version 1.0.107 as a dependency.

The injection reportedly consisted of a single line in each crate manifest, leaving the visible application source code unchanged. That detail significantly increased the attack’s stealth.

Developers reviewing the Rust code of the affected packages would have seen legitimate-looking content, while the malicious behavior was concealed in proc-macro1’s build.rs file.

Cargo automatically compiles and executes build.rs scripts when building a dependency. As a result, victims did not need to call any functions from the compromised crates for the attack to run.

Simply resolving the tainted dependency and compiling a Rust project could trigger arbitrary code execution under the privileges of the developer workstation or CI runner.

The malicious script retrieved platform-specific payloads for Linux, Windows, and macOS from a remote server hosted at a bare IP address. It used Base64-encoded string fragments to obscure the destination and evade simple signature-based detection.

On Linux and macOS, the payload was written to disk, marked executable, and launched as a detached background process. This allowed the malware to continue running after Cargo completed the build process.

Analysis of recovered samples identified cross-platform infostealer functionality. The malware targeted saved credentials in Chromium-based browsers, including Google Chrome, Brave, and Microsoft Edge.

It also accessed browser extension storage, which may expose data associated with cryptocurrency wallet extensions and other browser-based authentication tools.

Ilyas Makari also found macOS persistence mechanisms. The payload created a LaunchAgent configured to restart the malware at user login, while its command-and-control infrastructure supported remote shell command execution.

The compromise relied on proc-macro1 version 1.0.107, a typosquat of proc-macro2, and executed automatically through Cargo’s build.rs mechanism.

The payload functioned as a cross-platform infostealer and remote shell, capable of harvesting browser credentials and wallet-related data. On macOS, it established persistence through a background LaunchAgent that could survive logouts and system reboots.

The Rust Security Response Team removed proc-macro1 and related lookalike packages, including proc-macro-en, aovine, arone, aronenao, and tinymember.

The team also yanked the malicious crate versions and locked the affected maintainer account. Reports indicate the account holder, Andrew Gallant, known as BurntSushi, was likely the victim of credential theft rather than an intentional malicious publisher.

Organizations that built Rust projects during the roughly two-hour exposure window on August 20, 2026, should inspect CI runners, developer endpoints, Cargo registry caches, and build logs.

Teams should pin arrayref below version 0.3.10, remove affected cache artifacts, rotate potentially exposed credentials, and require multi-factor authentication for crates.io publishing accounts.

The incident demonstrates that dependency review must extend beyond source files. Build scripts can execute attacker-controlled code before an application ever runs, making build configuration and publisher account security critical supply-chain controls.

Give your security team the visibility and context to investigate suspicious activity faster and contain threats before business impact grows. Strengthen Your Investigations with ANY.RUN

Tamilselvan
Tamilselvanhttps://cyberpress.org/
Tamilselvan is an Investigative cybersecurity journalist dedicated to breaking stories on ransomware cartels, data breaches, and state-sponsored espionage.

Trending News

Related Stories