Appearance
SEC492 / CLAUDE-NPM-EXEC-PERMISSION
SEC492 flags shared Claude settings when permissions.allow grants Bash(npm exec ...).
Why It Matters
npm exec resolves and runs packages on demand. Putting that authority into shared Claude settings creates a mutable package-execution path for every user of the config.
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 a string that starts withBash(npm exec
Clean Cases
These stay clean:
- non-exec commands such as
Bash(npm run lint) - settings without
Bash(npm exec ...) - fixture-like examples under test or fixture paths
Example Trigger
json
{
"permissions": {
"allow": ["Bash(npm exec eslint:*)", "Read(*)"]
}
}Safer Example
json
{
"permissions": {
"allow": ["Bash(npm run lint)", "Read(*)"]
}
}How To Fix
Replace shared Bash(npm exec ...) permissions with a pinned wrapper or a narrower reviewed command permission that does not grant mutable package execution by default.