North Korean state-sponsored actor Sapphire Sleet executed a supply chain attack on the Rust ecosystem by compromising a maintainer account on crates.io. The attackers published malicious versions of arrayref (v0.3.10), internment (v0.8.7), and append-only-vec (v0.1.9), which introduced a typosquatted dependency, proc-macro1. The payload executed during the compilation process via build.rs scripts, enabling host enumeration, browser profile exfiltration, and persistence across Windows, macOS, and Linux. The campaign utilized a Domain Generation Algorithm (DGA) for C2 resiliency and disabled TLS validation to bypass security controls, specifically targeting developer workstations and CI/CD pipelines.
-
Incident Overview: Account Compromise & Delivery
- Attacker compromised a crates.io maintainer account to push malicious updates to three widely used crates.
- Deployed
proc-macro1as a typosquatted replacement for the legitimateproc-macro2library. - Targeted high-traffic packages;
arrayrefalone recorded 53.7 million downloads in the 90 days prior to the attack.
-
Attack Vector: Build-Time Execution Mechanics
- Execution occurred during
cargo buildvia thebuild.rsscript, bypassing the need for the developer to execute the compiled binary. - This vector directly compromises developer workstations and automated CI/CD runners during the dependency resolution phase.
- Exposure windows were brief, ranging from 86 to 107 minutes before remediation by The Rust Project.
- Execution occurred during
-
Payload Capabilities: Exfiltration & Persistence
- Conducted comprehensive host enumeration, including OS details, usernames, and installed application lists.
- Targeted browser profiles (Chrome, Brave, Edge) to steal saved login credentials and extension data.
- Established cross-platform persistence using Windows Registry Run keys, macOS LaunchAgents, and Linux systemd user services.
-
C2 Infrastructure & Attribution
- Attributed to Sapphire Sleet (DPRK) due to infrastructure overlaps with the Mastra and Axios campaigns.
- C2 URLs were reconstructed from Base64 fragments and employed a DGA generating 10 domains every five days.
- Security bypasses included the explicit disabling of TLS certificate validation for outbound C2 traffic.
-
Detection & Defensive Actions
- Inspect
Cargo.lockfiles for the presence ofproc-macro1or the compromised versions ofarrayref,internment, andappend-only-vec. - Monitor for anomalous outbound network traffic originating from build processes or compiler toolchains.
- Implement strict CI/CD pipeline auditing and utilize pinned dependencies to prevent automatic updates to malicious versions.
- Inspect
Related posts
- simplysecuregroup.com — Rust Supply Chain Attack Puts Build-Time Malware in Crates with 245 Million Downloads
- news4hackers.com — North Korean Hackers Exploit Rust Supply Chain: Cybersecurity Threat Revealed
- bleepingcomputer.com — Hackers poison arrayref Rust crate to push infostealer malware
- feeds.feedburner.com — Rust Supply Chain Attack Puts Build-Time Malware in Crates with 245 Million Downloads
- csoonline.com — Backdoored Rust packages hit crates.io, exposing developers to malware at build time
- Infosecurity-magazine
- Cryptopolitan
- Kucoin
- Reconbee
- Devops
- Research
- Stepsecurity
- Infoworld
- Tuxcare
- SecurityWeek — Rust Supply Chain Attack Linked to North Korean Hackers