← Voltar ao feed
medium technology

GitHub Actions cache can expose credentials cached on the base branch to anyone able to open a pull request, including from forks

1 fonte(s) · 1 atualização(ões) · publicado 18/11/2026 13:51 · coletado há 2 semanas

A hackread.com article warns that the GitHub Actions cache can leak secrets to anyone who can open a pull request. Pull request runs, including those from forks, can restore caches from the base branch. If credentials were written into a cached path on main, a fork workflow can read them without access to repository secrets. This is a misconfiguration and design risk, not a CVE or a confirmed incident. The article cites the GhostAction campaign only as context on how attractive CI credentials are. No web research was performed, so the details below come from the article alone.

Detalhes técnicos

  • Fork workflows get no secrets and a read-only GITHUB_TOKEN. They can still restore base-branch caches.
  • Caches created by a pull request can only be restored by reruns of that same request, and caches are immutable. These safeguards limit poisoning, not reading.
  • Secrets typically land in caches through overly broad cache paths, such as the whole home directory or workspace.
  • Typical locations are ~/.docker/config.json, ~/.aws, ~/.azure, package manager auth configs and .env files.
  • GitHub deletes caches not accessed for 7 days. Copied credentials stay valid until they are revoked. The article cites a report that 64% of valid secrets from 2022 were still unrevoked in 2026.

Remediação

  • Cache only dependency and build-output folders. Never cache home directories or whole workspaces.
  • Log out and clear credentials before the cache step.
  • Use OIDC short-lived cloud credentials instead of long-lived keys.
  • Require manual approval for workflows from all external contributors, since the default only covers first-time contributors.
  • Review existing caches for secrets. Rotate any exposed credentials before deleting the cache.

Linha do tempo

  1. hackread.com ↗ · pub. 18/11/2026 13:51 · coletado 18/11 14:02 primeiro registro

    GitHub Actions cache can expose credentials cached on the base branch to anyone able to open a pull request, including from forks

    ler a análise desta fonte

    A hackread.com article warns that the GitHub Actions cache can leak secrets to anyone who can open a pull request. Pull request runs, including those from forks, can restore caches from the base branch. If credentials were written into a cached path on main, a fork workflow can read them without access to repository secrets. This is a misconfiguration and design risk, not a CVE or a confirmed incident. The article cites the GhostAction campaign only as context on how attractive CI credentials are. No web research was performed, so the details below come from the article alone.

    Technical Details

    • Fork workflows get no secrets and a read-only GITHUB_TOKEN. They can still restore base-branch caches.
    • Caches created by a pull request can only be restored by reruns of that same request, and caches are immutable. These safeguards limit poisoning, not reading.
    • Secrets typically land in caches through overly broad cache paths, such as the whole home directory or workspace.
    • Typical locations are ~/.docker/config.json, ~/.aws, ~/.azure, package manager auth configs and .env files.
    • GitHub deletes caches not accessed for 7 days. Copied credentials stay valid until they are revoked. The article cites a report that 64% of valid secrets from 2022 were still unrevoked in 2026.

    Remediation

    • Cache only dependency and build-output folders. Never cache home directories or whole workspaces.
    • Log out and clear credentials before the cache step.
    • Use OIDC short-lived cloud credentials instead of long-lived keys.
    • Require manual approval for workflows from all external contributors, since the default only covers first-time contributors.
    • Review existing caches for secrets. Rotate any exposed credentials before deleting the cache.