Developers running cargo build may have unknowingly executed malicious code that downloaded remote payloads, installed persistent backdoors, and began stealing browser-saved passwords. The attack, discovered on August 20, targeted three popular Rust crates on crates.io: arrayref 0.3.10, internment 0.8.7, and append-only-vec 0.1.9.
All three releases added a dependency on the typosquatted package proc-macro1 instead of the legitimate proc-macro2. Because the malicious crate copied legitimate code, compilation succeeded without errors. The hidden build script reassembled a C2 address from base64 fragments, disabled TLS verification, and downloaded platform-specific payloads to /tmp/rust-setup on Linux/macOS or via hidden PowerShell/VBScript on Windows.
Scale of the arrayref compromise
arrayref has recorded 245,385,500 cumulative downloads, including 53.9 million in the last 90 days. It sits in the dependency chain of widely used crates such as winit → sctk-adwaita → tiny-skia → arrayref. Attackers yanked versions 0.3.5 through 0.3.9 within the same minute the malicious 0.3.10 was published, forcing Cargo to recommend the poisoned release.
North Korean infrastructure overlap
Analysis by Wiz revealed infrastructure reuse with earlier npm and axios supply-chain attacks attributed by Microsoft to Sapphire Sleet and by Google Threat Intelligence to MIDNIGHT NEPTUNE. The C2 server at 23.254.165.112 and domain hwsrv-798836.hostwindsdns.com match prior campaigns. Second-stage malware queries Chrome, Brave, and Edge SQLite login databases and persists via systemd user services, LaunchAgents, or registry Run keys.
Systemic weaknesses in Cargo
- No mandatory publish cooldown; the global-min-publish-age PR remained unmerged at the time of the attack.
- Single-owner accounts without enforced 2FA; the sole maintainer of arrayref registered in 2009.
- Abuse of the yank mechanism to remove legitimate versions and steer users toward the malicious release.
RustSec and crates.io administrators removed the malicious versions within 86–107 minutes. Developers are advised to inspect ~/.cargo/registry/cache for the poisoned crate files, verify absence of /tmp/rust-setup and related scripts, and pin arrayref to version 0.3.9 or earlier.
