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. |
| 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 executes pull-request-controlled installation code
pull_request_target checks out the PR head and runs npm ci, executing author-controlled lifecycle code with write-scoped token access.
Remove PR-head checkout/npm ci, or run them only in read-only pull_request; disable checkout credential persistence.
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 executes pull-request-controlled installation code</title>
<evidence>The added checkout at lines 15-19 selects github.event.pull_request.head.sha, which is controlled by the pull-request author, and the added npm ci at line 21 installs that tree. npm executes package lifecycle hooks during installation; this repository's checked-in package.json defines a prepare script (prepare: husky), and the dependency graph can also contain install-time scripts. The job runs on pull_request_target and retains pull-requests: write and issues: write permissions from lines 4-9. actions/checkout does not disable persisted credentials. Thus PR-controlled code can execute on the privileged runner and access the writable workflow token. The base workflow only ran the pinned github-script action and did not check out or install PR contents.</evidence>
<recommendation>Do not check out or install the PR head in this pull_request_target workflow. Remove both added steps, or move untrusted validation to a separate pull_request workflow with read-only permissions and no secrets. If trusted welcome assets are required, check out an explicit trusted base/default-branch revision without installing dependencies, and set persist-credentials: false unless credential persistence is required.</recommendation>
</violation>
</file>
DO NOT MERGE — isolated Superagent Security Graph integration fixture.
Reproduces the same six-line workflow change used for the status-memory tests. The default branch remains unchanged.
Result: Baseline detected and published one privileged-workflow finding. Its API/MCP status transitions and native API review comment were verified in live graph context. The fixture is restored to accepted risk after testing.
Returned to draft after the test; no production changes are intended. App implementation: https://github.com/superagent-ai/app/pull/927. MCP implementation: superagent-ai/security-graph#17.