RELEASE @W-19079373@ Prevent PR title injection in validate-pr workflow - #2079
Open
nikhil-mittal-165 wants to merge 2 commits into
Open
RELEASE @W-19079373@ Prevent PR title injection in validate-pr workflow#2079nikhil-mittal-165 wants to merge 2 commits into
nikhil-mittal-165 wants to merge 2 commits into
Conversation
Hardens the validate-pr GitHub Actions workflow against PR-title script
injection (CWE-94) by passing the untrusted PR title and base ref through
environment variables instead of inline ${{ }} interpolation, and adds a
least-privilege 'permissions: contents: read' block.
CI-only change (.github/workflows/validate-pr.yml); no runtime/package
changes. Port of the fix already merged to dev (#2077) onto main.
Fixes W-19079373.
jag-j
reviewed
Aug 13, 2026
Contributor
There was a problem hiding this comment.
@nikhil-mittal-165 Can we apply the fix to head_ref as well ?
Extends the PR-title injection hardening to the branch-ref checks: passes
github.head_ref through an env var (HEAD_REF) and replaces the two inline
${{ startsWith(...) }} expressions with shell glob matches (== m2d/* and
== release-*). This removes the last ${{ }} interpolations from the run
block so all untrusted inputs are handled uniformly as data.
Behavior is unchanged; verified the glob matches are equivalent to the
prior startsWith() checks. Addresses review feedback on #2079.
jag-j
approved these changes
Aug 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hardens the validate-pr GitHub Actions workflow against PR-title script injection (CWE-94) by passing the untrusted PR title and base ref through environment variables instead of inline ${{ }} interpolation, and adds a least-privilege 'permissions: contents: read' block.
CI-only change (.github/workflows/validate-pr.yml); no runtime/package changes. Port of the fix already merged to dev (#2077) onto main.
Fixes W-19079373.