Malicious Rust Crates Deliver Backdoor Through Build Scripts

· Original article ↗

Summary

Three hijacked Rust crates introduced a typosquatted dependency whose build script downloads and runs a platform-specific backdoor. The crates were removed, and researchers report infrastructure overlap with campaigns attributed to North Korean actors.

Key points

  • Malicious versions of arrayref, internment, and append-only-vec added the typosquatted proc-macro1 dependency.
  • Building an affected project triggered its build script, which downloaded and executed a platform-specific payload.
  • The backdoor collects host details, persists across Windows, macOS, and Linux, and supports remote commands and script execution.
  • It reads browser profiles and enumerates saved logins; the article clarifies that it does not retrieve the encrypted credential material.
  • Researchers found command-and-control infrastructure overlaps with campaigns attributed to DPRK-linked actors; the overlap does not by itself confirm attribution.
  • The Rust Security Response Team deleted the malicious releases and locked the account; it assesses that the maintainer's machine or credentials were compromised.
  • The article advises checking Cargo lockfiles and caches, treating hosts that built affected versions as compromised, rotating accessible secrets, and rebuilding from clean sources.

Article Details

Attack Vectors
  • Malicious Rust crates added the typosquatted proc-macro1 dependency, whose build script downloaded and executed a platform-specific payload when an affected project was compiled.
  • The second-stage backdoor beaconed to C2 over HTTPS POST, sent host information, and supported downloading and executing PowerShell or shell scripts.
  • The backdoor established persistence through a Windows Registry Run key, a macOS LaunchAgent, or a Linux systemd user service.
Defensive Notes
  • Search Cargo.lock files and local Cargo caches for the identified malicious crate names and versions.
  • Treat developer workstations and CI runners that built affected projects as compromised; rotate reachable credentials, tokens, keys, CI secrets, and signing keys, and rebuild artifacts from clean sources.
  • Remove the identified payload and launcher files, check for unrecognized systemd user services, HKCU Run entries, and LaunchAgents, and redeploy affected workloads from a clean state.
  • Review new or changed build dependencies, especially networking crates in packages without a reason to make network requests; investigate unexpected yanks of multiple stable versions.

Indicators of compromise

TypeIndicatorContext
DOMAINhwsrv-798836[.]hostwindsdns[.]comAttacker infrastructure hostname used by the operation.
EMAILrchaitm@gmail[.]comForged author email metadata in the malicious proc-macro1 package.
IPV423[.]254[.]165[.]112Attacker-controlled host serving the stage-two payload and used as the C2 address.
IPV423[.]254[.]167[.]107Stage-two C2 address reported live at publication.
SHA1f22e3e01e38bcdf001f0d15a2dbfdec5a1cf8effHash of the malicious proc-macro1-1.0.107 crate.
SHA1f4767ad92cb61401fd69139cade563501c39b991Hash of the Linux stage-two payload.
SHA1fc0fdb978eac72f4484b48db058e4473f1bc516eHash of the Windows stage-two payload.
SHA1ff7e20cf642346bf893f1eca808df82035bb53d0Hash of the macOS arm64 stage-two payload.
SHA25625ad700976873c76af785cb99b33c48db7df8b81f21d1e9e06b3676b9a9373aeHash of the hijacked arrayref-0.3.10 crate.
SHA25661198155da51b838772eecf5bfaac6cbc4dcc388dccc56658fc28a8e831b34d4Hash of the malicious proc-macro1-1.0.107 crate.
SHA256b5c1b5b0763a8809a644a8f92224653f0aca623a98eecc714d27f74b80fbe436Hash of the malicious proc-macro1-1.0.106 crate.

MITRE ATT&CK

Threat Actors

Vendors

Products

append-only-vecversions of three Rust crates were published to crates.io: arrayref@0.3.10, internment@0.8.7, and append-only-vec@0.1.9. The malicious crates added a typosquatted dependency (proc-macro1) whose build scriptarrayrefOn August 20, 2026, malicious versions of three Rust crates were published to crates.io: arrayref@0.3.10, internment@0.8.7, and append-only-vec@0.1.9. The malicious crates added a typosquatted dependency (proc-macro1)Bravehostname, username and operating system details, enumerates installed applications, and reads Chrome, Brave and Edge profiles for saved logins and extension settings, querying the browsers' SQLite credential storesEdgeusername and operating system details, enumerates installed applications, and reads Chrome, Brave and Edge profiles for saved logins and extension settings, querying the browsers' SQLite credential stores directly.Google ChromeCollects hostname, username and operating system details, enumerates installed applications, and reads Chrome, Brave and Edge profiles for saved logins and extension settings, querying the browsers' SQLite credentialinternmentAugust 20, 2026, malicious versions of three Rust crates were published to crates.io: arrayref@0.3.10, internment@0.8.7, and append-only-vec@0.1.9. The malicious crates added a typosquatted dependency (proc-macro1)proc-macro1internment@0.8.7, and append-only-vec@0.1.9. The malicious crates added a typosquatted dependency (proc-macro1) whose build script downloads and executes a remote binary. Notably, proc-macro1 was the firstproc-macro2proc-macro1 is a typosquat of the legitimate proc-macro2 crate (154M+ downloads).

Countries

Related Articles