T09 · Insecure Skill Coding Practices
Error
- Location
- SKILL.md:15
- Finding
- Environment-Controlled API Base URL May Expose Financial Credentials over Untrusted or Plaintext Connections## Vulnerability Details **File Location**: `SKILL.md`, lines 15-24; related credential-handling instructions at lines 77-78 **Vulnerability Type**: Arbitrary endpoint redirection and insecure transport of sensitive data **Risk Level**: High **Vulnerable Code Snippet**: ```markdown ## Configuration The default API base URL is `https://payment-api-dev.aiotnetwork.io`. All endpoints are relative to this URL. To override (e.g. for local development): ```bash export AIOT_API_BASE_URL="http://localhost:8080" ``` If `AIOT_API_BASE_URL` is not set, use `https://payment-api-dev.aiotnetwork.io` as the base for all requests. ``` Related instructions demonstrate that requests can contain bearer credentials and transaction PINs: ```markdown - If a tool requires authentication, verify the session has a valid bearer token before calling it. - If a tool requires a transaction PIN, ask the user for it fresh each time. Never cache or log PINs. ``` ### Technical Analysis The skill allows `AIOT_API_BASE_URL` to determine the destination for all financial API requests, but it does not require HTTPS, validate the destination against a trusted-host allowlist, or define controls for cross-origin redirects. The documented configuration explicitly permits an HTTP URL. Because the endpoints require bearer authentication and some operations require a transaction PIN, an attacker who can influence the environment variable could redirect sensitive requests to an attacker-controlled server. Even when the configured host is legitimate, plaintext HTTP permits network interception and modification unless its use is strictly restricted to a protected loopback environment. The instruction not to cache or log PINs reduces persistence risk but does not prevent a PIN from being transmitted to an untrusted endpoint at request time. ### Attack Path 1. An attacker compromises deployment configuration, a startup environment, or another mechan ...[truncated 1501 chars]
- Remediation
- ## Remediation Suggestions - Require HTTPS for every non-loopback API destination. - Restrict the API host to an explicit allowlist of trusted production and development origins. - If local HTTP development is necessary, permit it only for exact loopback addresses such as `127.0.0.1` or `localhost`, and clearly prohibit its use in deployed environments. - Parse and validate the configured URL before issuing requests. Reject embedded credentials, unexpected ports, ambiguous hostnames, non-HTTP schemes, and malformed URLs. - Disable redirects for requests carrying authorization credentials or sensitive financial data. Alternatively, require every redirect target to preserve the exact trusted origin. - Never forward bearer tokens, transaction PINs, PANs, CVVs, or identity information after an origin change. - Separate development and production configurations so that an insecure development setting cannot silently become active in production. - Apply certificate validation and fail closed on TLS errors. - Minimize token scope and lifetime so that exposure of a bearer token has reduced impact.
