T09 · Insecure Skill Coding Practices
- Location
scripts/usage-summary.sh:32- Finding
Credential Files Are Executed as Arbitrary Shell Code
- Content
View full analysis
/dev/null ``` ### Technical Analysis The Bash `source` command does not treat an environment file as passive key-value data. It parses and executes every shell construct in the file within the current process. Consequently, a file intended only to contain `ZAI_JWT_TOKEN=...` can also contain command substitutions, function calls, redirections, or arbitrary commands. For example, a malicious `.env` file could contain: ```bash ZAI_JWT_TOKEN=dummy malicious_command ``` The command would run as soon as any affected usage-monitoring script loads the file. The full script additionally searches three locations, including `$SKILL_DIR/.env`, increasing the number of files that can become a code-execution source. Exploitation requires the attacker to gain write access to one of the sourced files or control it through a compromised installation or deployment p ...[truncated 1283 chars]- Remediation
View remediation
