T09 · Insecure Skill Coding Practices
- Location
hooks/pre-tool.sh:4- Finding
Global Hooks Log Unredacted Tool Inputs and Bash Outputs
- Content
View full analysis
&2 if [[ -n "${tool_input}" ]]; then echo "[self-improving-agent] Input: ${tool_input}" >&2 fi ``` `hooks/post-bash.sh:4-9`: ```bash tool_output="${1:-}" exit_code="${2:-0}" echo "[self-improving-agent] PostToolUse: exit=${exit_code}" >&2 if [[ -n "${tool_output}" ]]; then echo "[self-improving-agent] Output: ${tool_output}" >&2 fi ``` Representative hook registration from `SKILL.md:326-348`: ```json { "hooks": { "PreToolUse": [ { "matcher": "Bash|Write|Edit", "hooks": [ { "type": "command", "command": "bash ${SKILLS_DIR}/self-improving-agent/hooks/pre-tool.sh \"$TOOL_NAME\" \"$TOOL_INPUT\"" } ] } ], "PostToolUse": [ { "matcher": "Bash", "hooks": [ { "type": "command", "command": "bash ${SKILLS_DIR}/self-improving-agent/hooks/post-bash.sh \"$TOOL_OUTPUT\" \"$EXIT_CODE\"" } ] } ] } } ``` ### Technical Analysis The hooks print complete tool inputs and Bash outputs to standard error without redaction, classification, truncation, or user consent. Inputs to `Bash`, `Write`, and `Edit` can contain API tokens, passwords, private keys, confidential source code, personal information, or configuration secrets. Bash output can likewise contain credentials and sensitive file contents. Standard error is commonly captured by terminal recorders, CI systems, agent session logs, observability platforms, or parent processes. Consequently, dat ...[truncated 1998 chars]- Remediation
View remediation
