Appearance
SEC502 / CLAUDE-GH-API-POST-PERMISSION
SEC502 flags shared Claude settings when permissions.allow grants blanket GitHub CLI API mutation authority through gh api --method POST.
Why It Matters
gh api --method POST is a generic remote mutation path against GitHub resources. In shared committed settings that is broader than most teams actually need and is harder to review than narrower workflow-specific subcommands.
Trigger Shape
The rule triggers only when all of these are true:
- the file is a detected Claude settings surface
- the path is not fixture-like
permissions.allowcontains the exact tokenBash(gh api --method POST:*)
Clean Cases
These stay clean:
- more specific read-only API calls such as
Bash(gh api --method GET:*) - settings files that do not grant blanket POST mutation access
- fixture-like examples under test or fixture paths
Example Trigger
json
{
"permissions": {
"allow": ["Bash(gh api --method POST:*)", "Read(*)"]
}
}Safer Example
json
{
"permissions": {
"allow": ["Bash(gh api --method GET:*)", "Read(*)"]
}
}How To Fix
Remove shared gh api --method POST permissions or replace them with narrower reviewed subcommands that keep remote GitHub mutations under explicit user control.