Skip to content

Actions: Normalize explicit untrusted checkout paths - #22221

Open
1sgtpepper wants to merge 4 commits into
github:mainfrom
1sgtpepper:agent/normalize-untrusted-checkout-paths
Open

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

Conversation

@1sgtpepper

@1sgtpepper 1sgtpepper commented Jul 21, 2026 •

Copy link
Copy Markdown

Fixes #22213.

Recognizes scripts and local actions executed from static relative actions/checkout paths in privileged workflows. Canonicalizing both paths before containment checks avoids matching sibling directories or paths that escape the checkout. Dynamic checkout paths retain the existing fallback; workspace-variable and context-expression resolution remain outside this change.

Validation: the CWE-829 query suite passed all 8 tests without learning on the PR head and the current-main merge candidate, using CodeQL 2.27.4+202610201846. git diff --check passed.

@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 3 times, most recently from 4050936 to 857758f Compare July 23, 2026 07:24
@1sgtpepper

Copy link
Copy Markdown
Author

@oscarsj, the current draft fixes #22213. I’m apprehensive about expanding this PR into shared path-model behavior, so I think the broader cases should be deferred to a separate follow-up. Does that scope sound right?

@1sgtpepper
1sgtpepper force-pushed the agent/normalize-untrusted-checkout-paths branch from 483c1f2 to 05933be Compare July 23, 2026 13:43
@JarLob

JarLob commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Although I'm not a big fan of regex (I think we need a proper bash parser. ...and powershell, and batch, and etc.). I have extended the PR here. @1sgtpepper feel free to merge into your PR.

@1sgtpepper

Copy link
Copy Markdown
Author

Thanks for digging into this! I’ll wait for Oscar’s take before deciding how much to incorporate.

@oscarsj

oscarsj commented Jul 31, 2026

Copy link
Copy Markdown
Member

I think the changes look good, I'm trying to get some Actions experts to review too. Keeping the scope as narrow as possible and iterating on follow ups sounds like the right approach to me, thank you!

Comment thread actions/ql/src/Security/CWE-829/UntrustedCheckoutCritical.ql Outdated
Comment thread actions/ql/src/Security/CWE-829/UntrustedCheckoutCritical.ql Outdated
@1sgtpepper
1sgtpepper force-pushed the agent/normalize-untrusted-checkout-paths branch from 4b199ee to f2017b6 Compare August 18, 2026 14:11
@1sgtpepper

Copy link
Copy Markdown
Author

@oscarsj Ping when you have a chance, thanks!

@1sgtpepper
1sgtpepper marked this pull request as ready for review October 21, 2026 06:56
@1sgtpepper
1sgtpepper requested a review from a team as a code owner October 21, 2026 06:56
Copilot AI max review requested due to automatic review settings October 21, 2026 06:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

This branch has not been deployed

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

5 participants