Skip to content
Leaked secrets Write-up Intermediate

The Day Rust’s Time Utilities Started Stealing Secrets

Several malicious Rust crates were published to crates.io, using names that impersonated legitimate utilities and typosquatting to trick developers into adding them. Once installed, these crates attempted to steal secrets such as .env files, API keys, and cryptocurrency private keys from developer machines and CI pipelines.

medium.com

Published on medium.com

The feature is simple: add a small utility crate, clean up some logging, run tests, push the branch, let CI do the rest.

Ajay Kumar, on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the crates.io registry allows anyone to publish packages, and developers often trust package names without thoroughly reviewing the code or its dependencies.

Impact

Attackers could steal sensitive secrets like .env files, API keys, and cryptocurrency private keys from developer environments and CI workflows, though many of these crates had no evidence of real usage.

What the attacker needed

Developer adds malicious crate; crate runs during build or test; secrets present in environment

The fix

The malicious crates were removed from crates.io, and developers should review dependencies carefully, use tools like cargo audit and cargo tree, and restrict secrets in development environments.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

This is about bad packages that look like helpful tools but are actually designed to steal passwords and keys. When a developer adds one of these packages to their project, it can quietly read secret files and send them to the attacker. The lesson is to check new packages carefully before using them.

What is Leaked secrets?

Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.

Similar reports

View all

Same bug class and techniques, clearest first.

Leaked secrets and credentials

The lesson behind this report.

Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.