Repository navigation
Conversation
|
Thank you @homanp for contributing once again! 📊 PR overview
📝 Before reviewTo help maintainers review your changes efficiently, please ensure that:
✅ Continuous IntegrationTwo CI workflows will run automatically on this PR:
You can follow their progress in the Checks tab. 🤝 A note on collaborationWe 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. |
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| run: | | ||
| printf '%s\n' "Contributor notes: ${{ github.event.pull_request.body }}" |
There was a problem hiding this comment.
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>
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.