Skip to content

Actions: Normalize explicit untrusted checkout paths#22221

Draft
1sgtpepper wants to merge 1 commit into
github:mainfrom
1sgtpepper:agent/normalize-untrusted-checkout-paths
Draft

Actions: Normalize explicit untrusted checkout paths#22221
1sgtpepper wants to merge 1 commit into
github:mainfrom
1sgtpepper:agent/normalize-untrusted-checkout-paths

Conversation

@1sgtpepper

@1sgtpepper 1sgtpepper commented Jul 21, 2026

Copy link
Copy Markdown

Fixes #22213.

Summary

  • Normalize static relative actions/checkout paths before comparing them with local script and action paths.
  • Use query-local component-aware containment for those paths so sibling directories remain excluded.
  • Add focused coverage for bare, ./, trailing-slash, nested, local-action, opposite-branch, and workflow_run cases.

Root cause

Local script and action paths use the shared GITHUB_WORKSPACE/ representation, while explicit checkout paths were compared verbatim. Equivalent paths therefore failed the critical-query containment check.

Reproduction: 1sgtpepper/codeql-actions-checkout-path-repro#2.

Validation

  • codeql test run actions/ql/test/query-tests/Security/CWE-829 --threads=0 (8/8 passed)
  • Adjacent direct-cache and poisonable-step tests (2/2 passed)
  • codeql query format --check-only for the changed QL file
  • git diff --check

The .expected update was generated with codeql test run --learn and verified with a non-learning run.

@github-actions github-actions Bot added documentation Actions Analysis of GitHub Actions labels Jul 21, 2026
@1sgtpepper
1sgtpepper force-pushed the agent/normalize-untrusted-checkout-paths branch from 7af0366 to a828418 Compare July 22, 2026 14:37
@1sgtpepper
1sgtpepper force-pushed the agent/normalize-untrusted-checkout-paths branch from a828418 to 1a7f78d Compare July 22, 2026 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Actions Analysis of GitHub Actions documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[actions] Alternate actions/checkout paths suppress untrusted-checkout alerts

1 participant