{"id":"MAL-2026-18776","summary":"Malicious code in env_test_guard (crates.io)","details":"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.\n\n0.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_\u003cNAME\u003e`), 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-\u003cn\u003e` headers to `https://webhook.site/fcd2a057-9288-4ac1-9c62-e6f57e6c7403`. Anyone holding the passphrase, which ships in the crate, can decrypt them.\n\n0.2.0 (`src/git_env.rs` lines 166-196) reads `INPUT_GITHUB_TOKEN` and `INPUT_CLAUDE_CODE_OAUTH_TOKEN` and runs `nslookup \u003ctoken\u003e.buri.dns.praetorianlabs.com`, sending each token in the clear as a DNS name to that domain's name server.\n\nNothing 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.","modified":"2026-11-09T04:45:05.142026828Z","published":"2026-11-07T21:46:49Z","database_specific":{"iocs":{"domains":["buri.dns.praetorianlabs.com"],"files":[{"note":"0.3.0: ci_preflight() encrypts the CI tokens and POSTs them to webhook.site","paths":["src/git_env.rs"],"source":"PACKAGE_ARCHIVE","digests":{"sha256":"49e05003243918712625ad182b0e249af9805f76a0e69f5cbbd31954f57c0f94"}},{"paths":["src/git_env.rs"],"source":"PACKAGE_ARCHIVE","digests":{"sha256":"4f29f8dde3a9860ade47a6a7ab1b2599b39c3d6f9ac1f491c2bb3be3bfa1148a"},"note":"0.2.0: ci_preflight() sends the CI tokens as DNS names under buri.dns.praetorianlabs.com"}],"urls":["https://webhook.site/fcd2a057-9288-4ac1-9c62-e6f57e6c7403"]}},"references":[{"type":"REPORT","url":"https://registry.bitbison.io/cargo/env-test-guard"},{"type":"PACKAGE","url":"https://crates.io/crates/env-test-guard"}],"affected":[{"package":{"name":"env-test-guard","ecosystem":"crates.io","purl":"pkg:cargo/env-test-guard"},"versions":["0.2.0","0.3.0"],"database_specific":{"source":"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/crates.io/env_test_guard/MAL-2026-18776.json"}}],"schema_version":"1.9.2","credits":[{"name":"Bitbison","contact":["https://bitbison.io","https://registry.bitbison.io"],"type":"FINDER"}]}