<- ALL CYBER NEWS
High
Rust, Supply Chain, crates.io, build.rs, DPRK, Infostealer, Cargo

Rust arrayref Crate Poisoned in Supply-Chain Attack
Attackers poisoned the Rust arrayref crate (245M+ downloads) with build-time infostealer malware via a typosquatted dependency. How it works and how to defend.
Attackers compromised the maintainer account behind the widely used Rust crate arrayref and published malicious releases that pull in build-time infostealer malware, and researchers have linked the campaign to North Korean threat actors. The poisoned releases were arrayref 0.3.10, append-only-vec 0.1.9, and internment 0.8.7, all under the same maintainer. Because arrayref alone has more than 245 million lifetime downloads, the potential exposure is enormous: any project that resolved the malicious versions and ran a build would execute the payload.
The mechanism is a clean illustration of why the build step is the weak link. The malicious releases added a dependency on proc-macro1, a typosquat impersonating the ubiquitous proc-macro2 crate. Inside proc-macro1, a build.rs script runs automatically during cargo build, reconstructing and executing a platform-specific infostealer that hunts for developer secrets: browser cookies, cryptocurrency wallet extensions, SSH keys, and cloud and environment credentials. No malicious runtime code needs to ship in your binary; simply compiling the dependency tree is enough to get popped.
The community response on r/rust and Hacker News landed on an uncomfortable irony: Rust delivers world-class runtime memory safety, yet cargo build will happily run untrusted native code with full access to ~/.ssh, ~/.aws, and your environment. Build scripts and procedural macros execute with the developer's privileges by design, which is exactly what supply-chain attackers monetize. The Rust Security Response Team pulled the malicious packages quickly, but in a continuous-integration world even a short window is enough to poison many automated builds and laptops, and the reuse of crypto-stealer tradecraft matches ongoing DPRK campaigns that already treat npm and PyPI as targets.
How does the arrayref build-time attack actually work?
The chain never relies on you calling a malicious function. The attacker publishes a patched version of a trusted crate that quietly adds a typosquatted dependency; that dependency ships a build.rs that Cargo compiles and executes during the build step; the script fetches and executes an infostealer as your user. It is arbitrary code execution triggered by the ordinary act of building, which is why "we only added a patch-level bump" offers no protection.
Attribute | Detail |
|---|---|
Poisoned crates | arrayref 0.3.10, append-only-vec 0.1.9, internment 0.8.7 |
Reach | arrayref alone has 245M+ lifetime downloads |
Vector | Typosquatted dep proc-macro1 with an auto-run build.rs |
Payload | Platform-specific infostealer (browser, wallets, SSH, cloud creds) |
Attribution | Linked to North Korean (DPRK) threat actors |
Response | Malicious releases removed by the Rust Security Response Team |
What should Rust developers do to defend their builds?
Pin and review your lockfile like source code: treat a Cargo.lock diff, especially a new or changed build.rs or an unfamiliar dependency such as proc-macro1, with the same scrutiny as a code change. Run cargo-vet or cargo-deny to audit dependencies and flag newly introduced build scripts, prefetch and build with --offline in CI so build scripts cannot phone home, and isolate builds with OS-level sandboxing (Landlock or seccomp on Linux, Seatbelt on macOS, AppContainer on Windows). If you built any affected version, rotate developer credentials, SSH keys, and cloud tokens that were reachable from the build host.
Our read
This is the same pattern we keep documenting across npm, PyPI, and now crates.io: the registry is a trust boundary, and the build is an unsandboxed execution environment sitting on top of your most sensitive secrets. Verifiable by design applies directly here. You cannot trust a version number, so you verify the artifact: know exactly what your dependency tree pulls in, treat lockfile changes as reviewable events, and prove your build environment cannot exfiltrate secrets even when a dependency turns hostile. Software-composition inventory is not paperwork; it is the control that turns the reach of a top-tier, 245-million-download dependency into a diff you can catch.
Reporting by BleepingComputer, SecurityWeek and The Hacker News; package and attribution details per those outlets. Sources linked above.
Related: the malicious LiteLLM PyPI releases and GhostSplice malicious MCP servers.