Restrict /apply-optimize workflow to trusted authors - #33
Closed
ctorres100 wants to merge 1 commit into
Closed
ctorres100 wants to merge 1 commit into
ctorres100 wants to merge 1 commit into
Conversation
The skill-optimize-apply workflow triggers on issue_comment and runs with contents:write and pull-requests:write. The only condition was that the comment is on a PR and contains "/apply-optimize", so any GitHub user could post that comment and invoke a write-capable job that checks out the repo and runs a third-party action in apply mode. Add an author_association gate so only OWNER, MEMBER, or COLLABORATOR can trigger the job, closing the privilege-escalation path. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Author
|
Closing at author's request. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Harden
.github/workflows/skill-optimize-apply.ymlagainst a CI privilege-escalation path.The workflow triggers on
issue_commentand runs withcontents: write+pull-requests: write, checks out the repo (fetch-depth: 0), and hands off to a third-party action (tesslio/skill-review-and-optimize) inapplymode. The only gate was:On a public repo, any GitHub user can post a comment containing
/apply-optimize, so any outsider could invoke this write-capable job.Fix
Add an
author_associationcheck so onlyOWNER,MEMBER, orCOLLABORATORcan trigger it:No behavior change for maintainers; external commenters can no longer start the job.
Notes / related findings (not in this PR)
While reviewing the repo I also noted, for separate follow-up:
convert_skills.pyauto-runspip install pyyamlon import, using barepip— andyamlis never actually used in the script (dead dependency block).python-publish.ymlbuilds a package on release but the repo has nopyproject.toml/setup.py.Happy to send these as their own PRs if wanted.
🤖 Generated with Claude Code