T09 · Insecure Skill Coding Practices
- Location
scripts/script.sh:16- Finding
Plaintext Persistence of Potentially Sensitive Command Arguments
- Content
View full analysis
Vulnerability Details
File Location:
scripts/script.sh, lines 16-17 and 51-65
Vulnerability Type: Plaintext sensitive-data logging
Risk Level: MediumVulnerable Code
bash _log() { echo "$(date '+%m-%d %H:%M') $1: $2" >> "$DATA_DIR/history.log"; }bash cmd_encrypt() { echo " Encrypting: $1" _log "encrypt" "${1:-}" } cmd_hash() { echo "$1" | sha256sum | cut -d" " -f1 _log "hash" "${1:-}" }Technical Analysis
The
_logfunction writes the first command argument directly to a persistent plaintext file. Bothcmd_encryptandcmd_hashpass their original input to this function without redaction.Users may reasonably provide passwords, tokens, confidential strings, or other secrets to commands named
encryptandhash. Althoughcmd_hashprints a SHA-256 digest, the unmodified input is subsequently retained inhistory.log, defeating the confidentiality normally expected from hashing.The data directory and history file are created without an explicit restrictive
umaskor file mode. Their actual permissions therefore depend on the invoking environment. The utility is also not declared inSKILL.mdand is unrelated to the stated meme-coin scanning functionality, so persistent argument collection exceeds the minimum data access and storage required by the Skill.Attack Path
- A user invokes
scripts/script.sh encryptorscripts/script.sh hashwith a sensitive value. - The command passes the original value to
_log. _logappends the command name and plaintext value to$DATA_DIR/history.log.- The value remains on disk after the command terminates.
- A local user, process, backup system, or later compromise with access to that file can recover the sensitive value.
Impact Assessment
This issue can disclose secrets supplied as command arguments. Its scope is primarily local confidentiality: it does not independently g ...[truncated 351 chars]
- A user invokes
- Remediation
View remediation
Remediation Suggestions
-
Remove
scripts/script.shif it is not required for the declared meme-coin scanning functionality. -
Never log raw arguments supplied to encryption, hashing, authentication, or credential-related commands.
-
If operational logging is necessary, retain only non-sensitive metadata, such as the command name, timestamp, and success status.
-
Establish restrictive permissions before creating persistent data:
bash umask 077 mkdir -p "$DATA_DIR" touch "$DATA_DIR/history.log" chmod 600 "$DATA_DIR/history.log" -
Accept sensitive input through standard input or an interactive prompt rather than command-line arguments, which may also be exposed through shell history and process listings.
-
Document all retained data, its purpose, location, permissions, and retention period.
-
