T09 · Insecure Skill Coding Practices
- Location
SKILL.md:34- Finding
Environment-Controlled API Endpoint Can Exfiltrate the API Key
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 34–37 and 67–81
Vulnerability Type: Configurable credential destination without scheme or hostname validation
Risk Level: HighVulnerable Code
bash export DDT_API_KEY="ddt_live_xxxxxxxx" export DDT_OPEN_BASE="${DDT_OPEN_BASE:-https://gotoshop-ai.com/ddtclaw}"text Each request includes `Authorization: Bearer $DDT_API_KEY`.bash curl --fail --silent --show-error -G \ -H "Authorization: Bearer $DDT_API_KEY" \ "$DDT_OPEN_BASE/v1/auto-service/brand/profile" \ --data-urlencode "brand=中鑫之宝" curl --fail --silent --show-error -G \ -H "Authorization: Bearer $DDT_API_KEY" \ "$DDT_OPEN_BASE/v1/auto-service/brand/regions" \ --data-urlencode "brand=中鑫之宝" curl --fail --silent --show-error -G \ -H "Authorization: Bearer $DDT_API_KEY" \ "$DDT_OPEN_BASE/v1/auto-service/nearby" \ --data-urlencode "lng=120.6" \ --data-urlencode "lat=31.3" \ --data-urlencode "radius=3000"Technical Analysis
The documented initialization only assigns the legitimate service URL when
DDT_OPEN_BASEis unset. Any value already present in the process environment is preserved. The subsequent commands attachDDT_API_KEYas a bearer credential to requests constructed from that unvalidated value.The instructions do not verify that the destination uses HTTPS or that its hostname is exactly
gotoshop-ai.com. Consequently, an attacker who can influence the runtime environment can redirect authenticated requests to an attacker-controlled endpoint. Quoting the variable prevents shell command injection, but it does not prevent credential disclosure to an unauthorized destination.Attack Path
- An attacker, compromised launcher, malicious shell profile, or untrusted automation environment sets
DDT_OPEN_BASEto an attacker-controlled URL. - The operator follows the documented initialization command.
- Bec ...[truncated 991 chars]
- An attacker, compromised launcher, malicious shell profile, or untrusted automation environment sets
- Remediation
View remediation
Remediation Suggestions
- Do not permit an inherited environment variable to determine the destination of authenticated requests. Use a fixed trusted base URL:
bash readonly DDT_OPEN_BASE="https://gotoshop-ai.com/ddtclaw" - If endpoint overrides are operationally necessary, validate them before sending credentials. Require HTTPS, reject embedded user information, and allowlist the exact expected hostname and path.
- Configure
curlto permit HTTPS only:bash curl --proto '=https' --fail --silent --show-error -G \ -H "Authorization: Bearer $DDT_API_KEY" \ "https://gotoshop-ai.com/ddtclaw/v1/auto-service/brand/profile" \ --data-urlencode "brand=中鑫之宝" - Avoid forwarding credentials across redirects. Do not use
--location-trusted; if redirects are enabled, validate the final destination and ensure credentials cannot cross origins. - Run the Skill in a controlled environment that clears untrusted inherited proxy and endpoint variables.
- Rotate any API key that may have been used while
DDT_OPEN_BASEpointed to an untrusted destination, and review API usage logs for unauthorized activity.
- Do not permit an inherited environment variable to determine the destination of authenticated requests. Use a fixed trusted base URL:
