Back to wire
Development·Article·Confirmed

Rust Security Team warns Miri caches can expose CI secrets to pull requests

The Rust Security Response Team says Miri persisted all environment variables under target/, creating a secret-exposure path when GitHub Actions jobs both supplied secrets and cached that directory for later pull-request runs. A narrowing patch is merged for the 22 September nightly; maintainers are advised to clear affected caches and rotate credentials that may have been exposed.

Published 21 Sept 2026, 02:00 · Updated 22 Sept 2026, 00:32

The leak path crosses a CI cache trust boundary

The Rust Security Response Team disclosed on 21 September that cargo miri had been storing all environment variables under the target directory so they could be reused across Miri invocations. That becomes a credential leak when a GitHub Actions job gives Miri access to secrets, caches target/, and later makes that cache readable to pull-request jobs. A contributor able to trigger PR CI can then recover values that were written by the more privileged run.

The issue depends on that combination of conditions rather than on Miri alone. The affected workflow must run cargo miri, expose secrets in the job environment, cache target/, and make that cache available to pull requests. The Rust team says public-cache readers can include contributors whose first pull request was previously approved, which can make extraction possible without granting the pull request direct secret access.

The patch narrows what Miri persists

Miri pull request 5337 changes the persistence logic so Miri keeps selected Cargo-related variables and OUT_DIR rather than the entire environment, while excluding CARGO variables that contain tokens. The patch was merged into rust-lang/miri on 21 September with its checks passing. The Rust advisory says the 22 September nightly is expected to contain the fix.

At the time of this article, the project's own advisory still describes that nightly as upcoming, so the merged patch should not be treated as proof that every installed nightly already contains the correction. Projects that depend on Miri need to verify the toolchain version they actually run.

Rust found one matching repository in its ecosystem scan

The Rust team says an ecosystem scan identified one repository matching the vulnerable pattern and seven more that did not appear vulnerable but warranted caution. Maintainers were contacted. The advisory does not say that the matching repository was exploited, that a secret was actually read by an attacker or that a downstream account was compromised.

Rust recommends affected projects stop caching that job, move secrets out of steps that invoke Miri or temporarily disable Miri, then clear the relevant cache. It also advises rotating secrets that might have been persisted. Those steps address both the future code path and credentials that may already exist in previously written cache entries.

The lesson extends beyond one Rust tool

The security boundary is broader than the patch. Build tools and build scripts can write environment-derived data into compilation artefacts without treating those values as secrets, while CI caches are deliberately designed to move artefacts between runs. A workflow that lets a secret-bearing job write to a cache later readable by untrusted code therefore needs its own threat model even when the build tool has no known vulnerability.

The confirmed facts are the Rust team's disclosure, the identified cache path and the merged Miri change. Public evidence reviewed for this story does not establish exploitation in the wild, so the incident should be treated as an exposure condition requiring remediation rather than as a confirmed breach.

Source trail

2 sources · 2 primary