← All stories
● Covered by 1 source · 1 reportMedium impact1 neutral

Miri Caching Vulnerability Exposes Secrets in GitHub Actions

🔄 Updated 2d ago
New to BrevFeed? We gather this story from every outlet covering it into one summary — ranked by real-world impact, not just the latest headline — so you never miss what matters. What is BrevFeed? →

Key points

  • Miri stored all environment variables in `target/` directory.
  • GitHub Actions caching could persist these variables.
  • PRs could read cached secrets from `target/`.
  • Fix limits Miri to `CARGO_*` (excluding tokens) and `OUT_DIR` variables.

Vulnerability Discovery

The Rust Security Response Team discovered that Miri, a Rust tool, stored all environment variables within the `target/` directory. This behavior, when combined with GitHub Actions' caching mechanism, created a potential security vulnerability. Secrets passed as environment variables could be inadvertently cached and subsequently accessed by pull requests (PRs).

How the Exposure Occurred

GitHub Actions allows caching directories between runs, with typical setups permitting main branch CI runs to write to the cache and PRs to only read from it. Rust projects often cache the `target/` directory to speed up CI. Because Miri stored all environment variables in `target/`, any secrets present in the environment during a CI run would be persisted in the cache. Malicious actors could then trigger a PR CI run, read these cached secrets, and potentially cover their tracks by pushing a second commit.

Mitigation and Fix

The immediate fix involves modifying Miri to only preserve `CARGO_*` environment variables (excluding `CARGO_*_TOKEN`) and `OUT_DIR`. This change prevents the broad storage of all environment variables. The Rust Security Response Team also conducted an ecosystem scan, identifying one repository with the issue and seven others that should exercise caution, and has contacted their maintainers.

Affected Users

Users are vulnerable if they run `cargo miri` in CI, and the step executing `cargo miri` has access to secrets as environment variables. This includes secrets passed directly to the step, set in the workflow's `env`, or persisted from a previous step. Users running Miri in their GitHub Actions setups are advised to check their configurations.

✨ This summary was generated by AI from the outlets' reporting listed below. It is not independently verified and may contain errors — check the original sources. How BrevFeed works →

The daily brief

One email each morning: the day's tech stories, clustered across outlets and summarized. No account needed.

One email a day. Unsubscribe in one click, any time.

Today's brief

Spend a few minutes, get the whole day. Every topic's top stories in one hands-free rundown — listen, watch, or read the transcript.

~26 min · 21 stories · Sep 23

▶ Play today's brief Listen on Spotify

New every morning, and the back catalogue is archived by date.

Reporting from

The Rust Security Response Team identified a vulnerability where Miri, when used with GitHub Actions caching, could expose environment variables containing secrets to pull requests. Miri's practice of storing all environment variables in the `target/` directory, which is often cached, allowed unauthorized access to sensitive information.