fix: update GitHub Actions workflow permissions#20034
fix: update GitHub Actions workflow permissions#20034stephanie-anderson wants to merge 1 commit intodevelopfrom
Conversation
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨Deps
Nuxt
Other
Bug Fixes 🐛
Documentation 📚
Internal Changes 🔧Core
Deps
Deps Dev
Other
🤖 This preview updates automatically when you update the PR. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Elevated
contents: writeonpull_request_targetworkflow- Removed unnecessary contents:write permission as the validate-pr action only needs pull-requests:write to close PRs, convert to draft, add labels, and create comments without ever modifying repository contents.
Or push these changes by commenting:
@cursor push 5719c69ec4
Preview (5719c69ec4)
diff --git a/.github/workflows/validate-pr.yml b/.github/workflows/validate-pr.yml
--- a/.github/workflows/validate-pr.yml
+++ b/.github/workflows/validate-pr.yml
@@ -9,7 +9,6 @@
runs-on: ubuntu-24.04
permissions:
pull-requests: write
- contents: write
steps:
- uses: getsentry/github-workflows/validate-pr@4ff40ada546d4a31b852a4279828b989a6193497
with:This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.
| runs-on: ubuntu-24.04 | ||
| permissions: | ||
| pull-requests: write | ||
| contents: write |
There was a problem hiding this comment.
Elevated contents: write on pull_request_target workflow
Medium Severity
Adding contents: write to a pull_request_target-triggered workflow grants the GITHUB_TOKEN write access to repository contents for PRs originating from forks. This is a well-documented attack vector — recent incidents (Trivy breach, hackerbot-claw campaign, March 2026) exploited exactly this pattern to push malicious code and exfiltrate secrets. A PR validation workflow typically only needs to read content and comment on PRs, making contents: write broader than expected. Flagged per the review rules' security vulnerability guidelines.
Triggered by project rule: PR Review Guidelines for Cursor Bot
size-limit report 📦
|
node-overhead report 🧳Note: This is a synthetic benchmark with a minimal express app and does not necessarily reflect the real-world performance impact in an application.
|



Seems the action needs
contents: writeafter all