T09 · Insecure Skill Coding Practices
Note
- Location
- scripts/script.sh:531
- Finding
- Undocumented Persistent Plaintext Activity History<![CDATA[ ## Vulnerability Details **File Location**: `scripts/script.sh:6-7, 531-537` **Vulnerability Type**: Plaintext storage of user-supplied generation metadata **Risk Level**: Low ### Technical Analysis The undocumented secondary implementation creates a persistent data directory whenever it runs and records command metadata in a plaintext history file: ```bash DATA_DIR="${CODE_GEN_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/code-generator}" mkdir -p "$DATA_DIR" ``` ```bash cmd_history() { local log="$DATA_DIR/history.log" [ -f "$log" ] && tail -20 "$log" || echo "No history yet." } _log() { echo "$(date '+%Y-%m-%d %H:%M') | $1 | $2" >> "$DATA_DIR/history.log" } ``` Generator functions pass user-supplied project, class, resource, and model names to `_log`. These values can reveal confidential project identifiers or development activity. The script does not obtain explicit consent, redact sensitive values, impose retention limits, or explicitly establish restrictive permissions. This behavior is not disclosed in `SKILL.md`, which identifies only `scripts/codegen.sh` as the main script. The history file is local and no code was found that transmits it to an external party. ### Attack Path 1. A user invokes `scripts/script.sh` with a confidential project, model, class, or resource name. 2. The corresponding command passes that value to `_log`. 3. `_log` appends the timestamp, command type, and supplied value to `history.log`. 4. The record persists after the command terminates. 5. Another local process or account with sufficient filesystem access can inspect the retained metadata. ### Impact Assessment The issue does not provide privilege escalation, remote code execution, or network exfiltration. Its scope is limited to disclosure of locally retained command metadata to principals that can read the history file. Potentially exposed information includes project names, internal resource names, model names, and other user-supplied identi ...[truncated 141 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Disable command history by default and require explicit user opt-in. - Clearly document what data is stored, where it is stored, and how long it is retained. - Avoid recording raw user input; store only a generic command type where possible. - Create the directory with restrictive permissions, such as mode `0700`. - Create the history file with mode `0600`, independent of an unsafe user umask. - Add a command to clear history and support configurable retention limits. - Warn users not to place secrets, credentials, tokens, or confidential names in generator arguments. ]]>
