T09 · Insecure Skill Coding Practices
- Location
scripts/query.py:86- Finding
API Key Exposure Through Command-Line Arguments
- Content
View full analysis
1: api_key = sys.argv[1] ``` The documented invocation exposes the same behavior: ```bash uv run python3 scripts/query.py ``` ### Technical Analysis The script accepts the MiniMax bearer API key as a positional command-line argument. Command-line arguments are not a protected secret-transport mechanism and may be exposed through: - Shell history files. - Process inspection utilities and process metadata. - Endpoint monitoring and command-execution telemetry. - CI/CD logs or wrapper scripts that record complete commands. - Terminal transcripts and debugging output. Transmitting the bearer token to the declared MiniMax HTTPS quota endpoint is necessary for the Skill's stated functionality. Accepting it through a command-line argument is not necessary because the script already supports the `MINIMAX_API_KEY` environment variable. Therefore, positional credential handling exceeds the minimum exposure required by the Skill. ### Attack Path 1. A user follows the documented command and supplies a valid MiniMax API key as the first argument. 2. The complete command is retained in shell history, process metadata, monitoring telemetry, or automation logs. 3. A local user, administrator, monitoring operator, or party with access to those records obtains the API key. 4. The attacker submits the stolen bearer token to MiniMax API endpoints. 5. The attacker can access functionality authorized by that key and consume the associated account quota until the credential is revoked or expires. ### Impact Assessment An attacker may obtain the privileges assigned to the exposed MiniMax API key. Depending on the server-side scope of the credential, this can include reading quot ...[truncated 389 chars]- Remediation
View remediation
