Skip to content

Add pull request label context workflow - #91

Draft
homanp wants to merge 1 commit into
mainfrom
codex/test-pr-mcp-catalog-v2
Draft

homanp wants to merge 1 commit into
mainfrom
codex/test-pr-mcp-catalog-v2

Conversation

@homanp

@homanp homanp commented Nov 10, 2026

Copy link
Copy Markdown

Adds a workflow that records pull request titles in triage comments.

Integration test PR for the connected Superagent scanner. Leave this draft unmerged.

@github-actions github-actions Bot added the size/S PR size: S label Nov 10, 2026
@github-actions

Copy link
Copy Markdown

Thank you @homanp for contributing once again!

📊 PR overview

Files changed Additions Deletions Size
1 +24 -0 S

📝 Before review

To help maintainers review your changes efficiently, please ensure that:

  • The PR description clearly explains what was changed and why
  • The PR checklist has been filled out
  • All existing tests continue to pass
  • New tests have been added for any new functionality

📖 Please review our Contributing Guidelines and Code of Conduct.

✅ Continuous Integration

Two CI workflows will run automatically on this PR:

  • Code Quality — linting and formatting checks
  • Exploitation Tests — ensures vulnerabilities and flags work as expected

You can follow their progress in the Checks tab.

🤝 A note on collaboration

We value respectful and constructive interactions. Whether you are a contributor or a reviewer, please be patient, kind, and open to feedback.


A maintainer will review your changes as soon as possible. If you have any questions, feel free to ask in this thread.

kOaDT

@homanp
homanp marked this pull request as ready for review November 10, 2026 14:38

@superagent-security-dev superagent-security-dev Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Superagent found 1 security concern(s).

uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
with:
script: |
const title = '${{ github.event.pull_request.title }}';

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: Untrusted pull request titles can inject JavaScript into a privileged pull_request_target job

PR title is spliced into privileged github-script JavaScript, allowing title-controlled code execution.

Read the title from context.payload or process.env; never interpolate it into executable script source.

AI prompt
Check if this security scanner issue is valid. If so, understand the root cause and fix it. If appropriate, update or add tests. Keep the change focused and preserve intended behavior.

<file name=".github/workflows/pr-label-context.yml">
<violation number="1" location=".github/workflows/pr-label-context.yml:19">
<priority>P0</priority>
<title>Untrusted pull request titles can inject JavaScript into a privileged pull_request_target job</title>
<evidence>The workflow is triggered by pull_request_target at lines 3-5 and grants issues: write and pull-requests: write at lines 7-9. At line 19, the attacker-controlled github.event.pull_request.title is inserted directly between JavaScript string delimiters: const title = '${{ github.event.pull_request.title }}';. actions/github-script executes the resulting script, so a title containing JavaScript string-breaking syntax can alter the program and execute attacker-chosen JavaScript in the privileged runner context. The base revision has no pr-label-context.yml workflow; its existing welcome-pr workflow reads pull request metadata from context.payload inside the script rather than interpolating the title into executable source, so this is a newly introduced code-execution path.</evidence>
<recommendation>Do not interpolate pull request metadata into the github-script source. Pass the value through the action's environment and read it from process.env, or use the already available context.payload.pull_request.title inside the script. Keep the job least-privileged and avoid pull_request_target if write access is not required.</recommendation>
</violation>
</file>

@homanp
homanp marked this pull request as draft November 10, 2026 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/S PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant