Skip to content

Commit e159403

Browse files
committed
default to not caching
GitHub Actions caches are shared across branches and workflows within a repository. This is an architectural property of the caching system that makes it inherently susceptible to cache-poisoning attacks: a low-privileged workflow (or a workflow triggered by a pull request from a fork via `on: pull_request_target`, a splendid footgun) can write malicious content into a cache entry, which a higher-privileged workflow on the default branch may later restore and execute. This attack surface has been demonstrated in practice by tools such as Cacheract (https://github.com/AdnaneKhan/Cacheract) and documented extensively in "The Monsters in Your Build Cache" (https://adnanthekhan.com/2024/05/06/the-monsters-in-your-build-cache-github-actions-cache-poisoning/). The OpenSSF has also flagged this vector in their guidance on mitigating attack vectors in GitHub workflows (https://openssf.org/blog/2024/08/12/mitigating-attack-vectors-in-github-workflows/). Now that not only the `minimal` but also the `build-installers` flavor (which were previously cached by default) are downloaded from the `ci-artifacts` release instead of being built from scratch every single time, the performance impact of this change is expected to be negligible. Given that the trust boundary between cache writers and cache readers is not well-defined, the safest default is to not use caching at all. Users who have evaluated the trade-off for their specific threat model can still opt in explicitly with `cache: true` or `cache: auto`. Assisted-by: Claude Opus 4.6 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent 9967127 commit e159403

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

action.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,14 @@ inputs:
3131
default: '250'
3232
cache:
3333
required: false
34-
description: 'Use @actions/cache to accelerate this Action'
35-
default: 'auto'
34+
description: >
35+
Use @actions/cache to accelerate this Action.
36+
Note: GitHub Actions caches are shared across branches and
37+
workflows within a repository, which makes them susceptible
38+
to cache-poisoning attacks (see e.g. Cacheract,
39+
https://github.com/AdnaneKhan/Cacheract). Caching is
40+
therefore disabled by default.
41+
default: 'false'
3642
github-token:
3743
description: >
3844
Personal access token (PAT) used to call into GitHub's REST API.

0 commit comments

Comments
 (0)