-
Notifications
You must be signed in to change notification settings - Fork 295
Disallow pull_request_target trigger in strict mode
#19951
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -11,6 +11,7 @@ | |||||||||
| // - Network access configuration | ||||||||||
| // - Top-level network configuration required for container-based MCP servers | ||||||||||
| // - Bash wildcard tool usage | ||||||||||
| // - Dangerous trigger events (e.g. pull_request_target) | ||||||||||
| // | ||||||||||
| // # Validation Functions | ||||||||||
| // | ||||||||||
|
|
@@ -19,6 +20,7 @@ | |||||||||
| // 2. validateStrictPermissions() - Refuses write permissions on sensitive scopes | ||||||||||
| // 3. validateStrictNetwork() - Requires explicit network configuration | ||||||||||
| // 4. validateStrictMCPNetwork() - Requires top-level network config for container-based MCP servers | ||||||||||
| // 5. validateStrictTrigger() - Refuses dangerous trigger events (e.g. pull_request_target) | ||||||||||
|
||||||||||
| // 5. validateStrictTrigger() - Refuses dangerous trigger events (e.g. pull_request_target) | |
| // 5. validateStrictTools() - Enforces restrictions on tool usage (e.g. bash wildcard constraints) | |
| // 6. validateStrictDeprecatedFields() - Flags usage of deprecated workflow fields in strict mode | |
| // 7. validateStrictTrigger() - Refuses dangerous trigger events (e.g. pull_request_target) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this table-driven test,
compiler.SetStrictMode(true)forces strict mode for every case, which overridesstrict: falsein the "pull_request_target is allowed in non-strict mode" fixture (CLI strict flag takes precedence). That case will fail under the current strict-mode precedence logic. Consider adding a per-testcliStrictflag (or similar) and only enabling strict mode for the strict-mode cases, leaving it unset/false for the non-strict case so frontmatter can disable strict mode.