T09 · Insecure Skill Coding Practices
- Location
SKILL.md:31- Finding
API Key Exposure Through Command-Line Arguments
- Content
View full analysis
python3 scripts/fetch_nutrient-query.py --mode 1 --num 5 --page 2 ``` The script also explicitly accepts the credential as a command-line option: ```python # scripts/fetch_nutrient-query.py:158 parser.add_argument("--key", help="API Key (可选,优先使用环境变量)") ``` ### Technical Analysis The documentation instructs users to include a TianAPI credential directly in the command line, while the implementation supports the same behavior through `--key`. Command-line secrets may be: - Saved in interactive shell history. - Visible in process listings while the program is running. - Captured by endpoint monitoring, process auditing, or diagnostic software. - Included in copied terminal transcripts and support logs. The documented positional command syntax is also inconsistent with the implementation, which requires named `--key` and `--word` options. Although this mismatch primarily affects reliability, users trying to correct the command may still place the secret in a visible `--key` argument. ### Attack Path 1. A user follows the Skill instructions or invokes the script with `--key`. 2. The API key becomes part of the process command line and may be recorded in shell history. 3. Another local user, monitoring agent, support operator, or process with access to history or process telemetry retrieves the key. 4. The exposed key is used to submit unauthorized requests to TianAPI. 5. The attacker consumes the victim's API quota or accesses any API operations authorized for that key. This path requires access to local process information ...[truncated 563 chars]- Remediation
View remediation
