T09 · Insecure Skill Coding Practices
- Location
SKILL.md:30- Finding
Bearer Token Disclosure Through Attacker-Controlled API Base URL
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 30–34 and 88–106
Vulnerability Type: Unvalidated endpoint configuration leading to credential disclosure
Risk Level: HighVulnerable Code
bash export DDT_OPEN_BASE="${DDT_OPEN_BASE:-https://gotoshop-ai.com/ddtclaw}" test -n "$DDT_API_KEY"text Requests uniformly use `Authorization: Bearer $DDT_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" curl --fail --silent --show-error -G \ -H "Authorization: Bearer $DDT_API_KEY" \ "$DDT_OPEN_BASE/v1/network/sales-shortlist" \ --data-urlencode "brand=茉莉奶白" \ --data-urlencode "city=上海市" \ --data-urlencode "months=6" \ --data-urlencode "size=10" curl --fail --silent --show-error -G \ -H "Authorization: Bearer $DDT_API_KEY" \ "$DDT_OPEN_BASE/v1/network/stores" \ --data-urlencode "brand=% Arabica" \ --data-urlencode "q=浦东" \ --data-urlencode "city=上海市" \ --data-urlencode "size=10"Technical Analysis
The setup preserves any preexisting value of
DDT_OPEN_BASEinstead of pinning or validating the documented service origin. The subsequent commands attachAuthorization: Bearer $DDT_API_KEYto requests constructed from that variable.No validation requires HTTPS or verifies that the parsed hostname is exactly
gotoshop-ai.com. Therefore, an attacker who can influence the environment may redirect authenticated requests to an arbitrary endpoint. Shell quoting prevents command injection through this variable, but it does not prevent credential exfiltration at the HTTP destination.The same requests can also disclose user-submitted addresses, landmarks, brand names, geographic filters, and business-analysis queries.
Attack Path
- An attacker gains the ability to define environm ...[truncated 1287 chars]
- Remediation
View remediation
Remediation Suggestions
-
Pin the API origin rather than inheriting an arbitrary environment value:
bash readonly DDT_OPEN_BASE="https://gotoshop-ai.com/ddtclaw" -
If endpoint configurability is required, parse and validate it before attaching credentials. Require:
- The
httpsscheme. - An exact approved hostname.
- An approved port.
- An expected base path.
- No embedded user information.
- No ambiguous hostname suffix matching.
- The
-
Construct authenticated requests only after validation succeeds. Abort on every unapproved origin.
-
Restrict redirects. Prefer
--max-redirs 0; if redirects are necessary, validate every destination and never forward authorization credentials across origins. -
Keep the key in a minimally scoped secret store or process environment, apply least-privilege API permissions, and rotate it periodically.
-
Document that users must clear or inspect inherited endpoint variables before making authenticated requests.
-
Revoke and rotate any API key that may already have been used while
DDT_OPEN_BASEpointed to an untrusted endpoint.
-
