Skip to content

fix(ci): prevent command injection vulnerability in PR title validation [PSIRT-0974799192]#676

Merged
vamshigovardhana merged 3 commits intowebex:nextfrom
vamshigovardhana:fix-pr-title-validation
Apr 28, 2026
Merged

fix(ci): prevent command injection vulnerability in PR title validation [PSIRT-0974799192]#676
vamshigovardhana merged 3 commits intowebex:nextfrom
vamshigovardhana:fix-pr-title-validation

Conversation

@vamshigovardhana
Copy link
Copy Markdown
Contributor

@vamshigovardhana vamshigovardhana commented Apr 22, 2026

Summary

  • Fixes command injection vulnerability reported in PSIRT-0974799192
  • Replaces unsafe bash string interpolation with github-script action
  • Makes PR title scope optional (both fix: description and fix(scope): description are now valid)
  • Adds security hardening: Unicode normalization, control character detection, 200-char length limit

Security Impact

The previous implementation using TITLE="${{ github.event.pull_request.title }}" in a bash run: block was vulnerable to command injection. Attackers could execute arbitrary code by crafting malicious PR titles with shell metacharacters.

This fix uses GitHub's github-script action which safely accesses the PR title through the context object without shell interpretation.

Test Plan

  • Tested against all 20 recently merged PRs - all would pass
  • Validated regex allows both with and without scope
  • Confirmed empty scopes feat(): are rejected
  • Verified control character detection works
02_53_59 02_40_31

Jira:https://jira-eng-gpk2.cisco.com/jira/browse/SPARK-793315

@vamshigovardhana vamshigovardhana requested a review from a team as a code owner April 22, 2026 11:56
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 90f49636ed

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread .github/workflows/deploy.yml Outdated
Comment on lines 133 to 135
# Mock version output for testing
OUTPUT="@webex/cc-components => 1.0.0-next.999"
echo "$OUTPUT"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P0 Badge Restore real package version generation

In the Deploy CD workflow for push to next, the versioning step now emits a hardcoded mock value (@webex/cc-components => 1.0.0-next.999) instead of running yarn package-tools increment. This makes publish-npm.outputs.package_versions incorrect on every real release, so downstream release comments/notifications will report the wrong package/version and changelog parameters for most deploys.

Useful? React with 👍 / 👎.

Comment thread .github/workflows/deploy.yml Outdated
Comment on lines 151 to 152
if: false
run: yarn workspaces foreach -W --from '${{ needs.analyze-changes.outputs.yarn-recursive }}' --verbose run deploy:npm --access public --tag ${GITHUB_REF##*/}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P0 Badge Re-enable npm deployment execution

The publish step is now permanently disabled with if: false, so no changed package can ever be deployed to npm in this production deploy workflow. Because this workflow still runs tagging/commenting jobs afterward, it can falsely signal successful releases while publishing nothing.

Useful? React with 👍 / 👎.

Comment thread .github/workflows/deploy.yml Outdated
name: Publish - Documentation
needs: [publish-npm,analyze-changes]
runs-on: ubuntu-latest
if: false # Skip for testing
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Re-enable documentation publishing job

The documentation publish job is now unconditionally disabled (if: false), which means deploy runs will stop updating docs/changelog artifacts entirely. Any release messaging that links readers to changelog content can become stale because the docs branch never receives updates.

Useful? React with 👍 / 👎.

…on [PSIRT-0974799192]

Replaces bash string interpolation with github-script action to safely validate PR titles and prevent command injection attacks. Also makes scope optional and adds security hardening (Unicode normalization, control character detection, length limits).
@vamshigovardhana vamshigovardhana force-pushed the fix-pr-title-validation branch from 90f4963 to 9198e27 Compare April 22, 2026 12:01
@aws-amplify-us-east-2
Copy link
Copy Markdown

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-676.d1b38q61t1z947.amplifyapp.com

@bhabalan
Copy link
Copy Markdown
Contributor

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Copy Markdown
Contributor

@riteshfyi riteshfyi left a comment

Choose a reason for hiding this comment

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

Looks Good.

@vamshigovardhana vamshigovardhana added the validated Indicates that the PR is ready for actions label Apr 28, 2026
@vamshigovardhana vamshigovardhana merged commit 273a2bf into webex:next Apr 28, 2026
43 checks passed
@github-actions
Copy link
Copy Markdown

Your changes have been merged!

Thank you for your contribution!

🤖 This is an automated message. For queries, please contact support.

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

Labels

validated Indicates that the PR is ready for actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants