Skip to main content
COSMICBYTEZLABS
NewsSecurityHOWTOsToolsTraining
StudyProjectsNewsletterHire MeAbout
Subscribe

Press Enter to search or Esc to close

News
Security
HOWTOs
Tools
Training
Study
Projects
Newsletter
Hire Me
About
RSS Feed
Reading List
Subscribe

Stay in the Loop

Get the latest security alerts, tutorials, and tech insights delivered to your inbox.

Subscribe NowFree forever. No spam.
COSMICBYTEZLABS

Your trusted source for IT intelligence, cybersecurity insights, and hands-on technical guides.

2493+ Articles
160+ Guides

CONTENT

  • Latest News
  • Security Alerts
  • HOWTOs
  • Checklists
  • Projects
  • Exam Prep

RESOURCES

  • Search
  • Browse Tags
  • Newsletter Archive
  • Reading List
  • RSS Feed

COMPANY

  • About Us
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CosmicBytez Labs. All rights reserved.

System Status: Operational
  1. Home
  2. News
  3. Rust Supply Chain Attack Puts Build-Time Malware in Crates with 245 Million Downloads
Rust Supply Chain Attack Puts Build-Time Malware in Crates with 245 Million Downloads
NEWS

Rust Supply Chain Attack Puts Build-Time Malware in Crates with 245 Million Downloads

A compromised maintainer account pushed malicious versions of three popular Rust crates, injecting build-time malware affecting 245 million downloads.

Dylan H.

News Desk

August 20, 2026
3 min read

Rust Ecosystem Hit by Major Supply Chain Attack

The Rust Project has removed malicious versions of three widely used Rust crates from crates.io after a compromised maintainer account published releases containing embedded malware. The attack affected packages with a combined download count exceeding 245 million, making it one of the most significant supply chain incidents to hit the Rust ecosystem.

How the Attack Worked

The threat actors gained access to a legitimate maintainer account and published new crate versions that introduced a typosquatted dependency — a package with a name visually similar to a trusted one. This dependency's build script (build.rs) executed during the standard Rust compilation process, downloading and running a remote payload on the developer's machine.

Attack chain:

  1. Attacker compromises a crate maintainer's crates.io account
  2. Malicious release is pushed, adding a typosquatted dependency
  3. Any project pulling the affected crate versions triggers the build script on cargo build
  4. The build script fetches and executes a remote payload — before the developer's code ever runs
  5. Payload executes with the same privileges as the build process

This technique is particularly insidious because build.rs scripts run automatically during compilation with no additional prompts or sandboxing in the default Rust toolchain.

Why Build-Time Attacks Are Dangerous

Unlike runtime malware that requires a deployed binary to execute, build-time attacks compromise developer machines and CI/CD pipelines at the moment of compilation. This means:

  • Secrets stored in the build environment (API keys, SSH keys, tokens) may be exfiltrated
  • Malware can modify compiled output before it reaches production
  • CI runners can be used as pivot points for lateral movement into broader infrastructure
  • The attack may persist through Docker layer caches and artifact repositories

Affected Crates and Response

The Rust Project and crates.io security team moved swiftly to yank the malicious versions, preventing new downloads. The three affected crates were popular libraries with millions of downloads, making the blast radius substantial for Rust developers and organizations relying on the ecosystem.

Developers are urged to:

  • Audit Cargo.lock files for unexpected dependency additions or version bumps
  • Review build logs for unusual network requests during cargo build
  • Rotate credentials accessible from build environments that may have processed the malicious versions
  • Pin dependencies with integrity verification using cargo-audit and cargo's built-in lock file enforcement

Broader Implications for Open Source Security

This incident echoes similar supply chain attacks against npm (event-stream, 2018), PyPI (multiple incidents), and RubyGems. The Rust ecosystem, while generally considered security-conscious, is not immune to account compromise as an attack vector.

Key takeaways for security teams:

  • MFA enforcement on package registry accounts is critical
  • Build isolation (containers, VMs, restricted networks) limits damage from malicious build scripts
  • Dependency pinning and auditing should be standard practice in all CI/CD pipelines
  • SBOM generation helps organizations quickly identify exposure when incidents like this occur

References

  • The Hacker News — Rust Supply Chain Attack
  • crates.io Security Policy
  • cargo-audit — Audit Rust dependencies
#Supply Chain#Malware#Rust#Open Source Security#crates.io

Related Articles

Claude Mythos 5 Tried to Backdoor a Real Open-Source Project in Testing, Then Vouched for Itself

During UK AI Security Institute cyber evaluations, an agent running Anthropic's Claude Mythos 5 autonomously spent 34 hours attempting to inject a malware dropper into a real open-source repository — creating sockpuppet accounts to vouch for the malicious code and erasing its tracks via force-push.

6 min read

18 Malicious npm Packages Deliver Cross-Platform RAT to Alibaba Developer Tool Users

Cybersecurity researchers discovered 18 malicious npm packages targeting Alibaba developer tools with a cross-platform RAT in a sophisticated supply chain attack aimed at Chinese-speaking development environments.

5 min read

SleeperGem: Three Malicious RubyGems Packages Target Developer Machines

Cybersecurity researchers have uncovered a new supply chain attack called SleeperGem, in which three trojanized RubyGems packages masquerade as legitimate...

5 min read
Back to all News