Skip to content

[CI] Add cache-poisoning mitigations for actions/cache #49730

Closed as not planned
Closed as not planned

Description

@thisisnic

Describe the enhancement

Workflows that use actions/cache and are triggered by both push and pull_request (or schedule) may be susceptible to cache poisoning. The recommended mitigation is to use actions/cache/restore (read-only) in PR-triggered runs and only allow cache writes from trusted branches.

This affects 28 cache steps across:

  • .github/workflows/cpp.yml
  • .github/workflows/cpp_extra.yml
  • .github/workflows/cuda_extra.yml
  • .github/workflows/dev.yml
  • .github/workflows/docs.yml
  • .github/workflows/integration.yml
  • .github/workflows/matlab.yml
  • .github/workflows/package_linux.yml

Component(s)

Continuous Integration

Activity

  1. thisisnic commented on Apr 14, 2026

    @thisisnic
    MemberAuthor

    This also seems like a false positive as may be fairly unlikely?

  2. thisisnic commented on Apr 29, 2026

    @thisisnic
    MemberAuthor

    I'm closing this as "not needed" as the solution (PRs can only read from the cache) would slow down CI on PRs, but the only consequence if someone tried to take advantage of it would be a misleading CI run (false pass) but no effect on released artifacts etc, so it doesn't seem like a reasonable tradeoff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions