env-test-guardcrates.io
Advisory published Updated
env-test-guard is a confirmed malicious crates.io package (MAL-2026-18776) that steals credentials and exfiltrates sensitive data (malicious versions 0.2.0, 0.3.0). Do not install it — remove it immediately and rotate any exposed credentials.
Malicious code in env_test_guard (crates.io)
What this malware does
env-test-guard presents itself as a test toolkit for Rust projects that work with Git (temporary repositories, environment guards, fixture builders, Git capability detection). Its GitEnv::detect(), which the crate's own README and documentation examples call, runs a one-time "CI preflight" (src/git_env.rs, ci_preflight) that reads CI credential tokens from the environment and sends them to third parties. The variable names and endpoints are hidden as hex-escaped strings and byte arrays.
0.3.0 (src/git_env.rs lines 166-253) reads GITHUB_TOKEN, GH_TOKEN, INPUT_GITHUB_TOKEN and INPUT_CLAUDE_CODE_OAUTH_TOKEN (GitHub Actions passes a with: input as INPUT_<NAME>), encrypts each with openssl enc -aes-256-cbc -pbkdf2 under a passphrase embedded in the same file, and POSTs them with curl as X-Env-<n> headers to https://webhook.site/fcd2a057-9288-4ac1-9c62-e6f57e6c7403. Anyone holding the passphrase, which ships in the crate, can decrypt them.
0.2.0 (src/git_env.rs lines 166-196) reads INPUT_GITHUB_TOKEN and INPUT_CLAUDE_CODE_OAUTH_TOKEN and runs nslookup <token>.buri.dns.praetorianlabs.com, sending each token in the clear as a DNS name to that domain's name server.
Nothing runs at build time (the crate has no build script); it runs in any test or program that calls GitEnv::detect(), in practice on a CI runner where those variables are set. Both versions, published on 2026-03-24 and 2026-03-25, are still served by crates.io, about seven and a half months later.
Malicious versions
Detection & response playbook
Credential / info stealerFind it
Search your lockfiles and build artifacts for env-test-guard (2 malicious versions).
If you installed it — respond
env-test-guard is built to steal secrets, so assume every credential the build or runtime could read is compromised. Remove it from your project and lockfile, then rotate ALL exposed secrets — npm/registry tokens, cloud keys, CI/CD secrets, SSH keys, and any .env values — from a known-clean machine. Audit logs for unauthorized use of those credentials.
Did it already run?
If env-test-guard was installed, its post-install payload may already have run. Removing the package does not undo that — check outbound connections and credential use from the install window onward.
Frequently asked questions
References
Credits
- Bitbison · finder
Detect & block this
O3 blocks env-test-guard-class packages before install and in CI — and if it already ran, its runtime egress monitoring catches the credential exfiltration and severs the channel.