Skip to content

RELEASE @W-19079373@ Prevent PR title injection in validate-pr workflow - #367

Merged
nikhil-mittal-165 merged 3 commits into
mainfrom
nmittal/W-19079373-validate-pr-main
Aug 14, 2026
Merged

RELEASE @W-19079373@ Prevent PR title injection in validate-pr workflow#367
nikhil-mittal-165 merged 3 commits into
mainfrom
nmittal/W-19079373-validate-pr-main

Conversation

@nikhil-mittal-165

Copy link
Copy Markdown
Contributor

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 (#366) onto main.

Fixes W-19079373.

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 (#366) onto main.

Fixes W-19079373.
@git2gus

git2gus Bot commented Aug 13, 2026

Copy link
Copy Markdown

Git2Gus App is installed but the .git2gus/config.json doesn't have right values. You should add the required configuration.

…-test failure on VS Code 1.131.0

(cherry picked from commit 622f857)
Comment thread .github/workflows/validate-pr.yml Outdated

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.

@nikhil-mittal-165 Same comment as the previous PR. Can we take care of head_ref as well?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

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 (mirror).

@aruntyagiTutu aruntyagiTutu 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.

Port of the already-reviewed/approved PR-title-injection fix (dev #366) onto main, plus it carries forward the previously-approved @vscode/test-electron 2.5.2→3.1.0 bump (dev #365, fixing the e2e smoke-test break on VS Code 1.131.0) since main hadn't picked that up yet. Both changes are unmodified ports of already-approved dev commits — validate-pr.yml diff is identical to #366 (including the follow-up head_ref env fix), and the test-electron/package-lock diff matches what I approved on #365.

CI-only + dev-dependency change, no product runtime impact. CI green across macOS/Ubuntu/Windows. Approving.

@nikhil-mittal-165
nikhil-mittal-165 merged commit 9e698c2 into main Aug 14, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants