GitHub Actions Hardens Pipeline Security by Introducing Granular Cache-Mode Permissions
GitHub has officially launched general availability for cache-mode in GitHub Actions across all platform tiers, giving engineering teams native, fine-grained control over cache access permissions at both the workflow and individual job levels. Practitioners can now configure four distinct cache access modes: read (allows restoring caches while blocking writes), write (allows both restoring and writing, the default for trusted push events), write-only (restricts actions to saving caches without prior hydration), and none (blocks cache interactions entirely). Job-level definitions override workflow-level policies, and permissions cascade restrictively into reusable workflows so that downstream pipelines cannot elevate their cache access beyond what the parent caller authorized.
This update addresses one of the most stubborn vulnerabilities in contemporary CI/CD ecosystems: pipeline cache poisoning. In standard pipeline configurations, shared build caches have historically operated with broad implicit write permissions. A compromised dependency, a malicious pull request running via pull_request_target, or an unvetted script step could overwrite compiled binaries, dependency wheels, or intermediate build layers stored in cache keys. By enforcing least privilege at the caching layer, platform teams can ensure that untrusted PR runs only read upstream baseline caches rather than polluting them with malicious payloads that might subsequently execute inside trusted deployment jobs.
This enhancement represents a broader maturation of CI/CD supply chain hardening. As software delivery pipelines evolved from simple automation scripts into mission-critical infrastructure, attack patterns shifted aggressively toward build-time environments. Recent industry initiatives around SLSA provenance, OpenID Connect (OIDC) federated authentication, and scoped GITHUB_TOKEN permissions have methodically removed ambient authority from CI runners. Granular caching policies close the remaining gap between immutable artifact storage and mutable execution state, establishing enforceable boundaries across the entire build lifecycle.
In practice, engineering teams should audit high-risk workflows immediately. Pull request validation workflows should be explicitly pinned to cache-mode: read, preventing arbitrary forks from modifying build artifacts. Conversely, primary branch builds should use default write permissions to keep cache registries fresh for downstream branches. Teams utilizing reusable workflows can now design dedicated cache-builder jobs that write artifacts in isolated sandboxes while consumer jobs consume them under read-only constraints. Implementing these controls eliminates a major vector for lateral movement across jobs with minimal configuration overhead.
Read original source