T09 · Insecure Skill Coding Practices
- Location
scripts/fetch_network_hot.py:133- Finding
API Key Exposure Through Command-Line Arguments
- Content
View full analysis
``` ### Technical Analysis The script accepts the TianAPI credential through the `--key` command-line argument. Secrets supplied as process arguments may be exposed through: - Shell history files. - Process inspection utilities and operating-system process metadata. - Command logging performed by terminal, automation, monitoring, or endpoint-management systems. - CI/CD job definitions and execution logs. The documentation increases the likelihood of exposure by explicitly recommending command-line entry. It also shows a positional argument even though the implementation only accepts `--key`, creating a documentation mismatch; however, use of the implemented `--key` option still exposes the secret. ### Attack Path 1. A user follows the documented approach or invokes the script with `--key`. 2. The API key becomes part of the command line. 3. The shell records the command in history, or process-monitoring software captures the argument. 4. A local user, administrator, support operator, or party with access to collected logs retrieves the key. 5. The party submits requests to TianAPI using the exposed credential. 6. The attacker consumes the account's API quota or accesses any other API capabilities authorized for that key. ### Impact Assessment This issue does not grant operating-system privileges by itself. Its scope is the TianAPI account and permissions associated with the expos ...[truncated 186 chars]- Remediation
View remediation
