[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"$fG7G2r_39CJMEpJZbcok-hF1qIkaKbaQ0PhodP8p_h9o":3},{"lesson":4},{"id":5,"slug":6,"article_id":7,"title":8,"body":9,"prevention":10,"framework_refs":11,"framework_notes":17,"status":23,"created_at":24,"published_at":25,"article":26,"tags":30,"podcasts":43,"controls":44},"6a8b658e-df64-49ff-aa92-da830b25ee91","github-actions-caches-can-leak-secrets-to-forked-pull-requests","beb02517-d9a4-46aa-a02b-612c5ebac996","GitHub Actions Caches Can Leak Secrets to Forked Pull Requests","GitHub Actions caches, when configured too broadly, can inadvertently store sensitive credentials such as Docker tokens, package manager secrets, or cloud CLI configuration files. Although GitHub's security model prevents untrusted forked workflows from directly reading repository secrets, a fork-initiated pull request can still restore a cache that happens to contain those credentials. This design gap means that overly permissive cache path definitions effectively bypass GitHub's intended secret isolation. The core failure is a misconfiguration — developers cache entire home or config directories without auditing what sensitive material those paths contain. This matters because an attacker who opens a pull request against a public repository can silently harvest credentials with significant blast radius.","**Immediate actions:**\n- Audit all existing GitHub Actions workflow files to identify cache steps with broad or home-directory paths and narrow them to only the specific dependency folders needed.\n- Rotate any credentials (Docker tokens, cloud CLI keys, package manager tokens) that may have been stored in previously published caches.\n- Set `cache-dependency-path` explicitly and validate cached paths in a dry-run to confirm no credential files are included.\n\n**Long-term improvements:**\n- Establish a policy that prohibits caching any path under `~\u002F.config`, `~\u002F.docker`, `~\u002F.aws`, or similar credential-bearing directories in CI\u002FCD workflows.\n- Use short-lived, scoped credentials (e.g., OIDC-based cloud authentication) in CI\u002FCD so that even if a cache is exposed, the credential has limited lifetime and permissions.\n- Implement a repository-level workflow security review gate so that changes to Actions workflow files require approval from a security-aware maintainer.\n\n**Detection measures:**\n- Enable GitHub's secret scanning and push-protection features to catch credentials committed or cached inadvertently.\n- Monitor audit logs for unexpected cache restore events originating from forked repository workflows.",[12,13,14,15,16],"CIS Control 4: Secure Configuration of Enterprise Assets and Software","NIST SP 800-53 CM-7: Least Functionality","NIST SP 800-53 AC-3: Access Enforcement","OWASP A05:2021 Security Misconfiguration","NIS2 Article 21(2)(e)",{"NIS2 Article 21(2)(e)":18,"NIST SP 800-53 AC-3: Access Enforcement":19,"NIST SP 800-53 CM-7: Least Functionality":20,"OWASP A05:2021 Security Misconfiguration":21,"CIS Control 4: Secure Configuration of Enterprise Assets and Software":22},"This point covers security in the acquisition, development, and maintenance of systems, including vulnerability handling; failing to securely configure CI\u002FCD pipeline caching during development pipeline setup falls directly under this obligation.","AC-3 requires enforcing approved authorizations for access to information; the misconfiguration allowed untrusted fork-based pull requests to effectively access credentials by restoring caches, circumventing intended access boundaries.","CM-7 requires restricting system functionality to only what is needed; configuring cache paths to include entire config directories goes beyond least functionality and exposes credentials unnecessarily.","OWASP A05 covers insecure default or overly permissive settings; defining cache paths that inadvertently include credential files is a textbook security misconfiguration in a CI\u002FCD pipeline.","This control requires maintaining secure, minimal configurations; caching overly broad directory paths that include credential files is exactly the kind of insecure default configuration CIS Control 4 asks teams to audit and harden.","published","2026-11-18T17:21:08.124711+00:00","2026-11-18T17:21:08.11+00:00",{"id":7,"url":27,"slug":28,"title":29},"https:\u002F\u002Fhackread.com\u002Fwhat-github-actions-cache-expose-to-pull-request\u002F","what-a-github-actions-cache-can-expose-to-anyone-who-opens-a-pull-request-4bb252","What a GitHub Actions Cache Can Expose to Anyone Who Opens a Pull Request",[31,37],{"id":32,"name":33,"slug":34,"description":35,"color":36},"1ec88fde-2d0f-4ed8-932a-33f5ccc0fdc7","Access Control","access-control","Excessive privileges, missing MFA, weak auth","#f97316",{"id":38,"name":39,"slug":40,"description":41,"color":42},"859cf0ad-a7e9-42bb-a75d-bac6511fa5d5","Configuration Management","configuration-management","Misconfigs, default credentials, exposed services","#eab308",[],[45,49,53],{"slug":46,"name":47,"problem":48},"identity-governance","Identity governance and single sign-on","People who leave or change roles lose access everywhere at once, and forgotten accounts stop piling up.",{"slug":50,"name":51,"problem":52},"secrets-management","Secrets management","API keys, tokens and passwords stop leaking from code, chat and configuration files.",{"slug":54,"name":55,"problem":56},"security-awareness-training","Security awareness training and phishing simulation","People recognise and report attacks instead of falling for them."]