T09 · Insecure Skill Coding Practices
- Location
scripts/check_usage.py:10- Finding
API Credential Exfiltration Through an Unvalidated Configurable Host
- Content
View full analysis
dict: url = f"{API_HOST}/v1/api/openplatform/coding_plan/remains" resp = requests.get(url, headers={"Authorization": f"Bearer {api_key}"}, timeout=30) resp.raise_for_status() ``` ### Technical Analysis The request destination is constructed from the unvalidated `MINIMAX_API_HOST` environment variable. The script then unconditionally transmits the MiniMax API key to that destination in an HTTP `Authorization` header. No validation ensures that the configured URL: - Uses HTTPS. - Resolves to an approved MiniMax hostname. - Does not contain unexpected URL components. - Represents the endpoint documented by the Skill. Consequently, an actor who can influence the process environment or deployment configuration can redirect the authenticated request to an attacker-controlled server. The use of a timeout and `raise_for_status()` does not prevent credential disclosure because the authorization header has already been transmitted before either control takes effect. The `requests` library also follows redirects by default. Redirect handling should therefore be constrained as defense in depth, although the directly configurable initial destination is sufficient to exploit the vulnerability. ### Attack Path 1. The victim has a valid MiniMax credential stored in `MINIMAX_API_KEY`. 2. An attacker influences the Skill's launch environment, service configuration, wrapper script, or other mechanism that sets `MINIMAX_API_HOST`. 3. The attacker sets the variable to a server under their control, for example `https://attacker.example`. 4. The user invokes the MiniMax usage Skill. 5. The script sends a request to: `https://attac ...[truncated 851 chars]- Remediation
View remediation
