justinmclean opened a new pull request, #4257:
URL: https://github.com/apache/iggy/pull/4257

   ## Which issue does this PR address?
   
   N/A
   
   ## Rationale
   
   The PR triage workflows trusted the collect artifact for identity, which a 
fork can forge
   
   ## What changed?
   
   `pr-triage-apply.yml` and `stale-prs-unmark-on-activity.yml` read the 
comment author, association and PR number straight from the `triage-event` 
artifact. On the `pull_request_review` path the collect workflow runs the PR 
head's own copy, so a fork could upload a forged payload: a spoofed `OWNER` 
passed the committer gate, and a newline in a field injected into `$GITHUB_ENV`.
   
   Both workflows now take only a numeric trigger id from the artifact and 
re-fetch the author, association, PR number, review state and body from the 
API. They verify the collect run's commit belongs to the claimed PR and that 
the review is as new as the run, and pass values through step outputs instead 
of `$GITHUB_ENV`.
   
   ## Local Execution
   
   - Passed
   - Pre-commit hooks ran
   
   ## AI Usage
   
   1. Claude Code (Opus).
   2. Drafted the workflow changes; I reviewed and revised them, and added the 
commit-membership and review-freshness checks.
   3. Verified with shellcheck and a YAML parse of both files, and by 
reproducing the original issue in a throwaway repo (a forged `OWNER` passed the 
gate and the env injection fired), then confirming the fixed workflow blocks 
both.
   4. Yes.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to