T09 · Insecure Skill Coding Practices
- Location
scripts/fetch_saylove.py:74- Finding
API Key Exposure Through URL Query Strings and Command-Line Arguments
- Content
View full analysis
``` The script supports a command-line key through the `--key` argument. ### Technical Analysis The API key is embedded in the query component of an HTTPS URL. TLS protects the request from passive network interception, but it does not prevent the complete URL from being recorded by the destination service, reverse proxies, observability systems, debugging tools, exception telemetry, or other infrastructure with access to request metadata. Supplying an API key through a command-line argument also creates local exposure risks. Depending on the operating system and shell configuration, command arguments may be visible through process-inspection interfaces while the script is running and may remain in shell history after execution. The network request itself is necessary for the Skill's declared API-backed functionality and is restricted to the declared TianAPI HTTPS endpoint. The audit found no transmission of unrelated files, environment variables, or user data. The issue is therefore the credential transport mechanism rather than unauthorized network access. There is also a documentation inconsistency: the examples show a positional API key, while the implementation accepts `--key`. Although the documented positional form will normally fail argument parsing, users may adapt it to `--key`, which retains the command-line disclosure risk. ### Attack Path 1. A user follows the Skill ...[truncated 1216 chars]- Remediation
View remediation
