T09 · Insecure Skill Coding Practices
- Location
scripts/script.sh:35- Finding
Undocumented Persistent Logging of Raw Command Arguments
- Content
View full analysis
> "$DATA_DIR/history.log"; } cmd_query() { echo " Query: $*" _log "query" "${1:-}" } cmd_import() { echo " Importing: $1" _log "import" "${1:-}" } cmd_export() { echo " Exporting to: ${1:-stdout}" _log "export" "${1:-}" } cmd_transform() { echo " Transforming: $1 -> $2" _log "transform" "${1:-}" } cmd_validate() { echo " Validating schema..." _log "validate" "${1:-}" } cmd_stats() { echo " Records: $(wc -l < "$DB" 2>/dev/null || echo 0)" _log "stats" "${1:-}" } cmd_schema() { echo " Fields: id, name, value, timestamp" _log "schema" "${1:-}" } cmd_sample() { [ -f "$DB" ] && head -5 "$DB" || echo "No data" _log "sample" "${1:-}" } cmd_clean() { echo " Cleaning data..." _log "clean" "${1:-}" } cmd_dashboard() { echo " Total: $(wc -l < "$DB" 2>/dev/null || echo 0) records" _log "dashboard" "${1:-}" } ``` ### Technical Analysis The script creates a persistent data directory under the invoking user's home directory, or at a caller-controlled location supplied through `INTERN_REPORT_DIR`. Its `_log` function appends command names and raw first arguments to `history.log`. Arguments to commands such as `query`, `import`, `export`, and `transform` may contain sensitive query content, filenames, directory structures, project identifiers, or other user-provided information. These values are stored without redaction, explicit consent, retention limits, or restrictive permission initialization. The resulting permissions depend on the invoking process's `uma ...[truncated 1790 chars]- Remediation
View remediation
