Repository navigation
Description
Describe the bug
releaseWorkflowsMustNotRestoreUntrustedCache (ISSUE-705) fires on every release or publish job that restores a cache whose key is not scoped to the release ref. Its premise, stated in the rule header and on the docs page, is that "GitHub Actions caches are shared across branches with a permissive prefix fallback, so a run on any feature branch, including an attacker's PR, can populate the same key that the release job later restores".
That is not how the cache service works. GitHub's documentation on cache access restrictions says:
Workflow runs can restore caches created in either the current branch or the default branch. If a workflow run is triggered for a pull request, it can also restore caches created in the base branch. Workflow runs cannot restore caches created for child branches or sibling branches. For example, a cache created for the child
feature-bbranch would not be accessible to a workflow run triggered on the parentmainbranch.
So a release job running on main (or on a tag) can only restore caches that were written by runs in its own scope or the default branch. A pull request run, from a fork or from a sibling branch, writes to its own scope (refs/pull/N/merge or the branch ref) and nothing on main ever reads it. The prefix fallback of restore-keys searches within the accessible scopes, it does not cross them. On top of that, GitHub now gives low-trust triggers read-only cache access by default (cache-mode), so even a pull_request_target job cannot write a cache unless the workflow sets cache-mode: write explicitly.
The real poisoning path therefore needs a writer inside the release ref's scope that runs attacker-influenced input: a pull_request_target, issue_comment or workflow_run job on the default branch that checks out or executes untrusted content and has cache write access, or a trusted-trigger job that consumes untrusted artifacts before saving the cache. A repository with none of those has no path from a pull request to the release cache, and the ref-scoped key the finding asks for changes nothing except making every release build start cold.
A maintainer pushed back on exactly this when the remediation was proposed, with the branch-isolation argument above, and was right.
To Reproduce
name: publish
on:
push:
branches: [main]
release:
types: [published]
jobs:
build-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/cache@v4
with:
path: ~/.cache/pip
key: pip-${{ hashFiles('requirements.txt') }}
restore-keys: pip-
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v6
with:
push: true
tags: ghcr.io/example/app:latest
cache-from: type=gha
cache-to: type=gha,mode=maxThis is the only workflow in the repository: no pull_request_target, no issue_comment, no workflow_run, no pull_request trigger at all, so nothing but a push to main or a release ever writes a cache in the scope this job restores from.
plumber analyze (0.6.0, built-in configuration) reports:
HIGH ISSUE-705 Release/publish workflow may consume a poisoned build cache (2 findings)
and the repository fails the gate at 80/100.
Expected behavior
ISSUE-705 should fire only when a cache writer with attacker-influenced input exists in a scope the release job restores from (the release ref itself or the default branch), for example:
- a job on a low-trust trigger (
pull_request_target,issue_comment,workflow_run,discussion_comment) on the default branch that saves a cache, which after thecache-modechange means it setscache-mode: writeexplicitly, or runs before that default applies; - a job on a trusted trigger that executes untrusted content (a checked-out pull request head, a downloaded artifact from an untrusted run) and then saves a cache in the default-branch scope.
ISSUE-802 and ISSUE-804 already identify those shapes, so the rule can reuse their facts. Without such a writer, the restore on the release path is not reachable from a pull request and the finding should stay silent, or at most report an informational "release job restores a cache, no untrusted writer found" line. The ref-scoped key remains a valid hardening recommendation, but it is not a High finding on its own.
The rule header, the finding message and the docs page should also drop the sentence about caches being shared across branches, since it contradicts GitHub's documented behavior and is the first thing a maintainer checks.
Screenshots
Not applicable.
Relevant versions and configuration files
- OS: Windows 11 (binary
plumber-windows-amd64) - Platform: GitHub (github.com)
- Plumber version: 0.6.0 (the finding also fires identically on 0.5.20)
.plumber.yaml: none, built-in default configuration
Relevant logs
The finding line above is the whole output for this control.
Additional context
The 2026 cache-poisoning incidents the control cites went through a privileged workflow that executed pull request content on the default branch and then saved the cache, which is the writer condition described above, not through branch sharing. Keeping the control, but anchoring it on that writer, keeps the true positives and removes a finding that maintainers can disprove by reading one paragraph of GitHub's documentation.
Note: If you submit a PR for this bug, please keep "Allow edits from maintainers" enabled so we can collaborate on the fix more easily.
Activity
Exypte commentedon Oct 16, 2026
I'm working on this one, a fix is on the way.
fix(controls)!: flag cache write granted to untrusted triggers
docs(issues): ISSUE-705 flags cache write granted to untrusted triggers
chore(release): 0.7.0 [skip ci]
fix(identity,pbom,cmd): nested identities key on the chain, the bill …
fix(identity,pbom,cmd): nested identities key on the chain, the bill …
fix(identity,pbom,cmd): nested identities key on the chain, the bill …
fix(identity,pbom,cmd): nested identities key on the chain, the bill …
fix(control,identity): nested findings carry their chain, remediation…
fix(control,identity): nested findings carry their chain, remediation…
fix(control,identity): nested findings carry their chain, remediation…
chore(release): 0.7.2 [skip ci]
fix(controls)!: flag cache write granted to untrusted triggers