Hook Development
Pass
Audited by Gen Agent Trust Hub on Feb 17, 2026
Risk Level: SAFECOMMAND_EXECUTION
Full Analysis
- Command Execution (LOW): The utility script
scripts/test-hook.shcontains a command injection vulnerability. It uses unsafe variable interpolation by embedding the$HOOK_SCRIPTvariable directly into abash -ccommand string. If a developer uses a filename containing shell metacharacters (e.g., semicolons), it could result in the execution of arbitrary commands. This violates the security best practices that the skill's ownhook-linter.shscript is designed to detect.\n- Indirect Prompt Injection (LOW): The provided example hooks (examples/validate-bash.sh,examples/validate-write.sh, andexamples/load-context.sh) are designed to process untrusted data from agent tool inputs. Although these specific scripts implement validation logic, they represent a surface for indirect prompt injection attacks.\n - Ingestion points: Untrusted tool input read via
stdininvalidate-bash.shandvalidate-write.sh.\n - Boundary markers: Not present; the scripts rely on logical parsing rather than explicit LLM delimiters.\n
- Capability inventory: The hooks have the capability to approve or deny agent actions, access the file system, and modify environment variables via
$CLAUDE_ENV_FILE.\n - Sanitization: The examples use
jqfor JSON parsing and regular expressions to filter for common attack patterns likerm -rfand path traversal (..).
Audit Metadata