Skip to content
supplychainattack.orgSupply chain attack incident catalog
resolvedcritical

Malicious code in proc_macro1 (crates.io)

proc-macro1, a typosquat of the legitimate proc-macro2 crate, was published to crates.io with malicious code that downloads and executes architecture-specific remote binaries during every build. The crate impersonated David Tolnay and was pulled in as a trojanized dependency by arrayref 0.3.10.

ShareXLinkedInHacker News
Disclosed
Last updated
Blast radius
All builds of proc-macro1 on supported platforms (Unix and Windows); downstream consumers of arrayref 0.3.10 which pulled in this trojanized dependency.
Ecosystems
Attack vectors
Affected entities
  • proc-macro1Typosquat of proc-macro2; all versions removed from crates.io

proc-macro1 was a typosquat package published to crates.io under the account 'dtolney', impersonating the legitimate maintainer David Tolnay (dtolnay). The package metadata forged authorship and pointed to a nonexistent GitHub repository to appear legitimate.

The malicious payload was embedded in build.rs. During every build on supported platforms, the script reconstructed a base64-encoded URL and downloaded an architecture-specific binary from https://23.254.165.112:9089/ over TLS with certificate validation disabled (using a custom verifier that accepts any certificate). The downloaded binary was then executed detached, with 23.254.165.112:443 passed as a command-and-control server argument. On Unix systems, the binary was written to /tmp/rust-setup and executed; on Windows, it was written to %TEMP%\rust-setup.ps1 and launched via a %TEMP%\rust-setup-launch.vbs launcher under wscript.exe.

The crate's source code was a copy of the legitimate proc-macro2, allowing dependent builds to succeed while the malicious build script executed silently. proc-macro1 served as the payload carrier for the trojanized arrayref 0.3.10 release. All versions have been removed from crates.io.

Credit: OpenSSF malicious-packages repository.

Indicators of compromise

Packages
  • proc-macro1
IPs
  • 23.254.165.112

Remediation

  • Immediately remove proc-macro1 from all project dependencies and lock files
  • Audit all builds that included proc-macro1 or arrayref 0.3.10 for signs of compromise (check for /tmp/rust-setup or %TEMP%\rust-setup.ps1 artifacts, network connections to 23.254.165.112)
  • Update to a patched version of arrayref that does not depend on proc-macro1
  • Review and revoke any credentials or secrets that may have been exposed on affected systems
  • Monitor systems that built with proc-macro1 for suspicious activity and potential command-and-control communications
  • Use dependency scanning tools to detect typosquats and verify package authenticity before use

Sources

  1. GitHub Advisory GHSA-m83q-4x86-96wh · GitHub Advisory Database

Cite this entry

"Malicious code in proc_macro1 (crates.io)." supplychainattack.org, Supply Chain Attack Incident Catalog. Disclosed August 21, 2026; last updated August 21, 2026. https://supplychainattack.org/incident/malicious-code-in-proc-macro1-crates-io-1t0bba

Suggest a correction

Found an error or have a newer source? Corrections to factual errors take priority over new entries.

  1. resolvedcritical

    Rust Supply-Chain Attack: arrayref 0.3.10 and the proc-macro1 Typosquat Execute a Remote Payload at Build Time

    A Rust supply-chain attack involved a malicious version of the arrayref crate (0.3.10) and a typosquatted proc-macro1 package that executed remote payloads at build time. The attack leveraged build-time code execution to compromise projects during compilation.

    CargoCompromised packageTyposquatting
  2. resolvedcritical

    Malicious code in proc_macro_en (crates.io)

    proc-macro-en is a malicious Rust crate published to crates.io on 2026-08-20 as part of a coordinated build-time payload campaign. The crate contained a build script that downloads and executes a remote binary from 23.254.165.112:9089 with command and control at 23.254.165.112:443. All versions have been removed from crates.io.

    CargoCompromised packageTyposquatting
  3. containedcritical

    Malicious code in chai-as-testkit (npm)

    The npm package chai-as-testkit is a typosquat/impersonation attack delivering obfuscated malicious code that executes on import. The package falsely claims to be a vulnerability management tool but ships pino library files under a different author, with a synthetic stub that loads a 4MB+ obfuscated bundle containing attacker-controlled code.

    npmTyposquattingCompromised package
  4. containedcritical

    Malicious code in mlflow-otel-instrumentor (PyPI)

    A typosquatting package named mlflow-otel-instrumentor was published to PyPI containing malicious code that downloads and executes a remote executable during installation. The payload exhibits worm-like behavior with intentions for persistence via systemd, cryptocurrency mining, and network propagation.

    PyPITyposquattingCompromised package