COMMENTARY: Software build pipelines have become attractive supply-chain targets because they execute third-party code while handling credentials used to publish products.
For organizations relying on GitHub Actions -- GitHub's CI/CD pipeline -- a compromised workflow can turn routine development activity into a security incident. Recent reports of compromised GitHub Actions being re-enabled with malicious code still present highlight the risks of trusting automation components that can change without warning.
[SC Media Perspectives columns are written by a trusted community of SC Media cybersecurity subject matter experts. Read more Perspectives here.]
Poisoning the GitHub Actions cache offers a less visible route into these environments. An attacker gets a lower-trust workflow to save malicious files in a shared cache. A more privileged workflow later retrieves those files and may execute them with access to sensitive credentials.
In a May 2026 analysis of GitHub workflows linked to PyPI packages, researcher Andrew Nesbitt identified roughly 15,000 repositories where privileged jobs could retrieve caches writable by less-trusted jobs, although he described that figure as an upper-bound estimate.
GitHub tightened default cache access for certain untrusted workflows in June 2026 and introduced more granular access controls in September.
These safeguards reduce exposure, but organizations remain responsible for how cached information moves between development and release processes. Security teams can address the remaining risks in five ways:
- Limit cache access based on job responsibilities: GitHub’s cache-mode setting offers four access levels: read, write, write-only and none. “Read” restores entries without saving new ones, “write” does both, “write-only” saves without restoring, and “none” blocks cache access entirely. A job-level setting overrides the workflow-level one. Routine testing generally requires read access, while release jobs should avoid caches entirely. Teams should explicitly define these permissions instead of relying on defaults that may let trusted workflows write new entries. Understanding how the GitHub Actions cache gets scoped across branches and workflow events also helps identify where cached content could move between processes with different trust levels.
- Keep cached content out of software releases: Stop privileged release workflows from restoring cached material. Nesbitt recommends separating these processes because malicious entries can otherwise reach the final software package. In December 2024, attackers exploited this weakness in the Ultralytics project. A poisoned cache reached its publishing workflow, resulting in malicious versions 8.3.41 and 8.3.42 being distributed through PyPI. Similar attacks affected other Python projects in May 2026. Organizations should build releases from verified inputs rather than material saved during less-trusted development activity. This may increase build times, but the additional overhead is a reasonable trade-off for protecting software distributed to customers.
- Review which trusted workflows can modify caches: GitHub’s newer protections focus on certain untrusted workflows, but many routine operations retain permission to create or update cache entries. These include code updates, scheduled automation, manually initiated tasks and release activities. A compromised third-party action or dependency operating within an otherwise trusted workflow can therefore introduce malicious content into a cache. Restricting access for external contributors alone will not eliminate the exposure. Security teams should periodically review which workflows can save cached files, minimize unnecessary write permissions and verify the integrity of third-party automation components. Make cache modification an explicitly authorized capability, not an assumed convenience.
- Keep sensitive information out of cached files: GitHub’s own guidance warns: “Don’t store sensitive information in a cache.” Nevertheless, build processes can inadvertently save authentication tokens, cloud credentials or configuration files containing secrets alongside ordinary dependencies. Organizations should review cached directories with the same care applied to published software artifacts. This includes checking whether temporary files or generated build outputs contain sensitive information. Anyone authorized to retrieve a cache entry can also potentially examine its contents. Access restrictions help, but preventing secrets from entering the cache represents the stronger safeguard.
- Clear caches after security incidents or permission changes: A poisoned cache entry can remain available until it’s deleted or automatically removed. Consequently, rotating exposed credentials after a suspected compromise may leave malicious build inputs untouched. Make cache deletion part of incident-response procedures whenever a workflow, external action or dependency has been suspected of compromise. Teams should also reassess stored entries when branch protections change or additional contributors receive permission to modify trusted code. GitHub offers cache management through its web interface, API and command-line tools. Organizations using persistent self-hosted runners must also clear local build caches separately, since GitHub’s centralized controls do not cover them.
GitHub’s recent changes reduce opportunities for cache poisoning, but they cannot determine which build inputs the organization should trust. Shared caches deserve the same scrutiny as external software dependencies, particularly when they can influence release pipelines. For security teams, separating routine development conveniences from privileged publishing operations helps prevent a seemingly minor cache compromise from becoming a broader supply-chain incident.
David Balaban, owner, Privacy-PC
SC Media Perspectives columns are written by a trusted community of SC Media cybersecurity subject matter experts. Each contribution has a goal of bringing a unique voice to important cybersecurity topics. Content strives to be of the highest quality, objective and non-commercial.