T09 · Insecure Skill Coding Practices
- Location
SKILL.md:31- Finding
API Key Exposure Through Command-Line Arguments
- Content
View full analysis
``` The implementation accepts the credential through a command-line option: ```python parser.add_argument("--key", help="API Key (optional, environment variable preferred)") ``` ### Technical Analysis The Skill explicitly recommends passing the TianAPI key as a command-line argument. Command-line secrets may be retained in interactive shell history and may be visible in process inspection interfaces while the process is running. Depending on operating-system configuration, other local users, monitoring agents, diagnostic tools, or process supervisors may be able to record these arguments. Passing a credential in this manner is not necessary for the Skill's waste-classification functionality. The implementation already supports the dedicated `TIANAPI_LAJIFENLEI_KEY` environment variable and a local `.env` file. Therefore, documenting and supporting routine command-line credential entry exceeds the minimum secret exposure required for the declared operation. The documentation also uses positional arguments, while the implementation expects `--key` and `--word`. This mismatch is primarily a correctness defect, but it may encourage repeated commands containing the secret while users troubleshoot execution. ### Attack Path 1. A user follows the documented command and enters the TianAPI key directly in a terminal. 2. The shell records the command, including the key, in its history file, or a local process-monitoring ...[truncated 1020 chars]- Remediation
View remediation
