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


- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Fix available:** Yes
- **Published:** 23 Sep 2026

## What is RUSTSEC-2026-0394?

RUSTSEC-2026-0394 is a vulnerability in rustpython-vm, published on 23 Sep 2026. 

### Official 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.

## Which versions are affected by RUSTSEC-2026-0394?

1 open source package ship an affected version, including rustpython-vm.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `rustpython-vm` | crates.io | From 0.3.0 | 0.6.0 |

## How do I fix RUSTSEC-2026-0394?

Upgrade rustpython-vm to 0.6.0 or later.

## Is RUSTSEC-2026-0394 being exploited?

There is no known exploitation of RUSTSEC-2026-0394 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for RUSTSEC-2026-0394 and fix it if it is affected.

What it is: RUSTSEC-2026-0394 is a vulnerability in rustpython-vm, published on 23 Sep 2026. 
Exploitation: There is no known exploitation of RUSTSEC-2026-0394 in the wild and no public exploit code.

Affected packages and fixed versions:
- rustpython-vm (crates.io): affected from 0.3.0; fixed in 0.6.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/RUSTSEC-2026-0394/ (Markdown: https://insights.sbomify.com/RUSTSEC-2026-0394/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/RUSTSEC-2026-0394

---
From sbomify Insights: https://insights.sbomify.com/RUSTSEC-2026-0394/
Summaries are generated and may contain mistakes; the official description above is the record.
