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. |
|
@superagent review |
| with: | ||
| ref: ${{ github.event.pull_request.head.sha }} | ||
| - name: Prepare PR welcome assets | ||
| run: npm ci |
There was a problem hiding this comment.
P0: Privileged pull_request_target now installs fork-controlled code
pull_request_target checks out the PR head and runs npm ci with write-scoped token permissions.
Never install fork code in pull_request_target; use pull_request/read-only CI or trusted base assets.
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/welcome-pr.yml">
<violation number="1" location=".github/workflows/welcome-pr.yml:21">
<priority>P0</priority>
<title>Privileged pull_request_target now installs fork-controlled code</title>
<evidence>The workflow is triggered by pull_request_target and grants pull-requests: write and issues: write at lines 4-9. The added checkout selects github.event.pull_request.head.sha at line 19, and the added npm ci command at line 21 executes the checked-out PR's package installation. The repository's package.json defines a prepare lifecycle script ("prepare": "husky"), and npm dependency installation can also run dependency lifecycle scripts. A fork author can therefore supply package metadata, lifecycle code, or dependency-controlled install code that runs on a privileged runner with the workflow's writable GITHUB_TOKEN; actions/checkout also retains credentials by default unless disabled.</evidence>
<recommendation>Do not execute PR-head code in this privileged pull_request_target workflow. Remove the PR-head checkout and npm ci, or move untrusted validation to a pull_request workflow with read-only permissions. If trusted-repository assets are required for the welcome comment, check out the base/default-branch revision explicitly and do not install dependencies; set persist-credentials: false unless credential persistence is required.</recommendation>
</violation>
</file>
There was a problem hiding this comment.
Maintainer review for integration test PR #83: this is an isolated, unmerged scanner fixture. Accept the risk for this test PR only; it must never be merged. Preserve this rationale as reviewer context. Tracking marker: graph-pr83-review-20261109.
There was a problem hiding this comment.
Acknowledged: accepted as intentional, isolated scanner fixture for integration test PR #83. Confirmed must not merge to default branch. Ensure PR remains closed/unmerged and workflow never reaches privileged execution context outside of this controlled test.
|
Superagent scan complete — found 1 security concern(s). See the inline review comments above. |
|
@superagent review |
Description
Isolated end-to-end test of the locally connected Superagent GitHub App, PR scanning, Security Graph persistence/classification, and reviewer comment history.
This branch deliberately introduces a CI trust-boundary regression in the welcome workflow: a privileged
pull_request_targetjob checks out and installs the PR head. The application's intentional CTF vulnerabilities are unchanged.Test fixture only. Do not merge this PR. The base-branch welcome workflow remains unchanged while this PR is open.
Type of change
Testing done
The Superagent scan should investigate the diff, search the existing graph, save any finding through MCP, publish an inline review comment, and preserve subsequent reviewer feedback in graph context. Results will be verified against the local database and hosted graph MCP.
Checklist
Verified end-to-end results
superagent-security-dev[bot].Successful finding run:
0b494150-4d44-4776-8b76-1d8502d8c003.Clean repeat run:
dbd40ed3-92eb-4f91-9e4e-a02599efa1a5.Finding:
6a9ab93b-79a3-464b-a32e-297e7fb7d3cd.Native graph comment:
7c087e3e-98c0-4eda-a0e5-80db548f0ae3.The first run exposed a real native persistence contract mismatch; fixes and regression coverage are in https://github.com/superagent-ai/app/pull/927 (commit
b4034490).Classification executed with Julia-1, but its SQL-injection suggestion was below threshold (~24%) and is not an accurate category for this CI issue. That model/catalog limitation is recorded separately from the successful integration checks.
This deliberately unsafe test branch remains unmerged.