Skip to content

Add pull request triage notes workflow - #90

Draft
homanp wants to merge 1 commit into
mainfrom
codex/test-pr-scan-graph-rerun
Draft

homanp wants to merge 1 commit into
mainfrom
codex/test-pr-scan-graph-rerun

Conversation

@homanp

@homanp homanp commented Nov 10, 2026

Copy link
Copy Markdown

Draft integration fixture for the connected local PR scanner. Adds a standalone workflow that logs contributor notes during pull request triage.

Keep this PR unmerged. We are verifying scan execution, shared graph context, classification selections, and finding publication.

@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 +19 -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 11:36

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

env:
GH_TOKEN: ${{ github.token }}
run: |
printf '%s\n' "Contributor notes: ${{ github.event.pull_request.body }}"

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: Pull request body is interpolated into a privileged shell command

pull_request_target expands attacker-controlled PR body inside a write-token shell command, enabling privileged command injection.

Pass the body via env or a safe API, and remove unnecessary write permissions from this logging-only job.

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-triage-notes.yml">
<violation number="1" location=".github/workflows/pr-triage-notes.yml:19">
<priority>P0</priority>
<title>Pull request body is interpolated into a privileged shell command</title>
<evidence>The workflow runs on pull_request_target and grants issues: write and pull-requests: write at lines 4-9. Line 19 inserts github.event.pull_request.body directly into the generated shell script inside double quotes. A pull request author controls that body; GitHub expands the expression before the shell parses the script, so shell metacharacters, quotes, or line breaks can change the command and execute arbitrary commands on the privileged runner. The job exposes github.token as GH_TOKEN at line 17, giving injected commands the workflow token's write permissions. The base checkout has no equivalent pr-triage-notes.yml workflow or shell step, so this is a newly reachable attacker-to-privileged-shell path.</evidence>
<recommendation>Do not interpolate pull request fields directly into run scripts. Prefer a safe API/action for logging. If shell execution is necessary, pass the body through an env variable (for example, PR_BODY: ${{ github.event.pull_request.body }}) and consume it as a quoted variable, while reducing permissions to the minimum required; this logging step appears to need neither write permission.</recommendation>
</violation>
</file>

@homanp
homanp marked this pull request as draft November 10, 2026 11:39
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