<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/github-actions-adds-cache-mode-to-limit-cache-poisoning-risk-lmky1pezr" -->

---
title: GitHub Actions Adds cache-mode to Limit Cache Poisoning Risk
description: GitHub Actions now supports cache-mode, a per-workflow or per-job setting that limits access to the shared Actions cache and targets the cache poisoning...
canonical: https://daily.dev/posts/github-actions-adds-cache-mode-to-limit-cache-poisoning-risk-lmky1pezr
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: GitHub Actions Adds cache-mode to Limit Cache Poisoning Risk | daily.dev
og:description: GitHub Actions now supports cache-mode, a per-workflow or per-job setting that limits access to the shared Actions cache and targets the cache poisoning...
og:url: https://daily.dev/posts/github-actions-adds-cache-mode-to-limit-cache-poisoning-risk-lmky1pezr
og:image: https://api.daily.dev/og/posts/LMkY1pEzr.png
og:image:alt: GitHub Actions Adds cache-mode to Limit Cache Poisoning Risk
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# GitHub Actions Adds cache-mode to Limit Cache Poisoning Risk

**[Socket](https://daily.dev/sources/socketdev)** · 3 min read · 1 upvotes · 0 comments

## Summary

GitHub Actions now supports cache-mode, a per-workflow or per-job setting that limits access to the shared Actions cache and targets the cache poisoning technique used in attacks against the Ultralytics PyPI package, TanStack npm packages, and the Cline npm package. It supports four values: read, write, write-only, and none, with job-level settings overriding workflow-level ones and enforcement carried through reusable workflows. GitHub added write-only after feedback from security researcher Adnan Khan, and recommends setting cache-mode: none for AI agent workflows that process untrusted issue or pull request text. The feature complements earlier read-only cache defaults for untrusted triggers shipped in June 2026 but does not address other Actions risks like untrusted code checkout or OIDC token minting inside runners.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://socket.dev/blog/github-actions-cache-mode>

## Questions this post answers

### What is cache-mode in GitHub Actions and what values does it support?

Cache-mode is a GitHub Actions setting, added in September 2026, that controls how workflows and jobs access the shared Actions cache at a least-privilege level. It supports four values: read (restores but blocks saves, default for low-trust events like pull_request_target), write (restores and saves, default for trusted events like push), write-only (saves but blocks restores), and none (blocks all cache access). Job-level settings override workflow-level ones, and access caps carry through reusable workflows.

_Track GitHub Actions security changes like this on daily.dev before they affect your CI/CD pipeline._

### How did the TanStack npm cache poisoning attack happen?

Attackers chained a cache poisoning technique with a pull_request_target pwn request to publish 84 malicious versions across 42 @tanstack/* packages in May 2026. Cache poisoning works because an entry written to the shared Actions cache in one context can be restored and executed in another; an attacker with write access to a cache key that a trusted workflow later reads can plant malicious artifacts that run with that workflow's permissions and secrets.

_Developers securing their CI/CD supply chain follow attack breakdowns like this on daily.dev._

### Does build provenance like SLSA or Sigstore detect a poisoned GitHub Actions cache?

No. SLSA provenance and Sigstore signatures still pass on a build that restored a tampered cache entry, because the attestation covers the build's origin (that it ran where and when the workflow declared) rather than the integrity of inputs pulled from the cache. This is why GitHub built a separate cache-mode control instead of relying on provenance attestation to catch cache poisoning.

_Anyone relying on build attestations for supply chain trust should track gaps like this on daily.dev._

## Similar posts on daily.dev

- [GitHub Actions Cache Poisoning is eating open source](https://daily.dev/posts/github-actions-cache-poisoning-is-eating-open-source-dyhf0mvj0) · Neciu Dan · 0 upvotes · 0 comments
- [GitHub Separates Who Writes Code From Who Runs Your CI](https://daily.dev/posts/github-separates-who-writes-code-from-who-runs-your-ci-nku4hdcup) · DevOps.com · 0 upvotes · 0 comments
- [GitHub Actions hardens checkout security to block ‘pwn request’ attacks](https://daily.dev/posts/github-actions-hardens-checkout-security-to-block-pwn-request-attacks-9pqi2ntb0) · InfoWorld · 0 upvotes · 0 comments

---

Tags: [#security](https://daily.dev/tags/security), [#github](https://daily.dev/tags/github), [#cicd](https://daily.dev/tags/cicd), [#github-actions](https://daily.dev/tags/github-actions)

[View this post on daily.dev](https://daily.dev/posts/github-actions-adds-cache-mode-to-limit-cache-poisoning-risk-lmky1pezr)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"GitHub Actions Adds cache-mode to Limit Cache Poisoning Risk","url":"https://daily.dev/posts/github-actions-adds-cache-mode-to-limit-cache-poisoning-risk-lmky1pezr","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/github-actions-adds-cache-mode-to-limit-cache-poisoning-risk-lmky1pezr"},"datePublished":"2026-09-16T21:35:55.794Z","dateModified":"2026-09-16T21:49:22.845Z","description":"GitHub Actions now supports cache-mode, a per-workflow or per-job setting that limits access to the shared Actions cache and targets the cache poisoning...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/178459d60e2c6ae515f05939cc03d890?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/178459d60e2c6ae515f05939cc03d890?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Socket","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Socket","logo":"https://media.daily.dev/image/upload/s---oEn9czC--/f_auto/v1716187892/logos/socketdev","url":"https://daily.dev/sources/socketdev"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/github-actions-adds-cache-mode-to-limit-cache-poisoning-risk-lmky1pezr","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"security,github,cicd,github-actions","timeRequired":"PT3M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Socket","item":"https://daily.dev/sources/socketdev"},{"@type":"ListItem","position":3,"name":"GitHub Actions Adds cache-mode to Limit Cache Poisoning Risk"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/github-actions-adds-cache-mode-to-limit-cache-poisoning-risk-lmky1pezr#faq","mainEntity":[{"@type":"Question","name":"What is cache-mode in GitHub Actions and what values does it support?","acceptedAnswer":{"@type":"Answer","text":"Cache-mode is a GitHub Actions setting, added in September 2026, that controls how workflows and jobs access the shared Actions cache at a least-privilege level. It supports four values: read (restores but blocks saves, default for low-trust events like pull_request_target), write (restores and saves, default for trusted events like push), write-only (saves but blocks restores), and none (blocks all cache access). Job-level settings override workflow-level ones, and access caps carry through reusable workflows. Track GitHub Actions security changes like this on daily.dev before they affect your CI/CD pipeline."}},{"@type":"Question","name":"How did the TanStack npm cache poisoning attack happen?","acceptedAnswer":{"@type":"Answer","text":"Attackers chained a cache poisoning technique with a pull_request_target pwn request to publish 84 malicious versions across 42 @tanstack/* packages in May 2026. Cache poisoning works because an entry written to the shared Actions cache in one context can be restored and executed in another; an attacker with write access to a cache key that a trusted workflow later reads can plant malicious artifacts that run with that workflow's permissions and secrets. Developers securing their CI/CD supply chain follow attack breakdowns like this on daily.dev."}},{"@type":"Question","name":"Does build provenance like SLSA or Sigstore detect a poisoned GitHub Actions cache?","acceptedAnswer":{"@type":"Answer","text":"No. SLSA provenance and Sigstore signatures still pass on a build that restored a tampered cache entry, because the attestation covers the build's origin (that it ran where and when the workflow declared) rather than the integrity of inputs pulled from the cache. This is why GitHub built a separate cache-mode control instead of relying on provenance attestation to catch cache poisoning. Anyone relying on build attestations for supply chain trust should track gaps like this on daily.dev."}}]}
```

