AI-generated editorial illustration; not a documentary photograph.
The Rust Security Response Team has warned that running Miri in GitHub Actions can expose secrets when a workflow caches the target/ directory. Miri currently stores environment variables there so it can preserve build-related state between runs; cached artifacts may then be readable by pull requests.
How the exposure works
The risk depends on several conditions working together. A project must run cargo miri in CI, provide secrets to that step or its wider job environment, cache target/ through a mechanism such as actions/cache or swatinem/rust-cache, and allow pull-request workflows to read the cache. In a common setup, runs on the main branch can write the cache while pull requests can read it.
The team says someone able to open pull requests could use a later CI run to extract data from a cached target/ directory. It also notes that overwritten commits and older CI logs may eventually disappear, making this activity harder to investigate.
Who should check
Projects that meet those conditions should inspect their workflows. The Rust team says its ecosystem scan found one repository with the issue and seven others that were not apparently vulnerable but should take care. It cautions that the scan was imperfect and recommends maintainers assess their own configurations.
Mitigation and patch
Short-term options include disabling the cache for the affected job, limiting secrets to steps that do not invoke Miri, or temporarily disabling Miri. After changing the workflow, maintainers should clear the relevant cache and consider rotating secrets that may have been exposed.
The planned fix restricts Miri's preserved environment to CARGO_* variables, excluding CARGO_*_TOKEN, and OUT_DIR. The team says the change is expected in the nightly release on 2026-09-22, but may not yet be available in the nightly channel when the advisory was published.
The warning extends beyond Miri: the team says Cargo, Miri and Rust do not guarantee that environment variables will never be copied into compilation artifacts, and build scripts may also write environment data to disk. Workflows that let public caches be written while secrets are present therefore require separate review.
Source: GitHub Actions leaking secrets when Miri output is cached

Leave a Reply