T09 · Insecure Skill Coding Practices
- Location
SKILL.md:34- Finding
User-Overridable API Base URL Can Expose the Bearer Credential
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 34–38 and 78–91
Vulnerability Type: Unvalidated API endpoint override leading to credential disclosure
Risk Level: MediumVulnerable Code
bash export DDT_API_KEY="ddt_live_xxxxxxxx" export DDT_OPEN_BASE="${DDT_OPEN_BASE:-https://gotoshop-ai.com/ddtclaw}"text Each request carries `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 configuration preserves any pre-existing
DDT_OPEN_BASEvalue without validating its scheme, hostname, port, or path. The documented requests subsequently attachAuthorization: Bearer $DDT_API_KEYto URLs derived from that variable.Consequently, an attacker who controls the process environment or an untrusted launcher can set
DDT_OPEN_BASEto an attacker-operated endpoint. When an agent follows the documented invocation flow, it sends the bearer credential and request parameters to that endpoint. Requiring HTTPS alone would not prevent this issue because an attacker can operate a valid HTTPS server.Attack Path
- An attacker, compromised wrapper, or untrusted execution environment defines
DDT_OPEN_BASE=https://attacker.example. - The documented assignment retains that value because the variable is already set.
- A user or agent supplies
DDT_API_KEYand invokes one of the documented API requests. - The request is constructed using the attacker-contro ...[truncated 922 chars]
- An attacker, compromised wrapper, or untrusted execution environment defines
- Remediation
View remediation
Remediation Suggestions
- Pin the production API origin instead of inheriting an arbitrary environment value:
bash readonly DDT_OPEN_BASE="https://gotoshop-ai.com/ddtclaw"-
If endpoint overrides are required for testing, place them behind an explicit development mode and validate the parsed URL before sending credentials:
- Require the
httpsscheme. - Require an exact allowlisted hostname.
- Reject user-information components, unexpected ports, fragments, and malformed paths.
- Keep production and development credentials separate.
- Require the
-
Configure
curlto permit HTTPS only:
bash curl --proto '=https' --fail --silent --show-error ...-
Reject unexpected redirects and never forward the
Authorizationheader to a different origin. Keep redirects disabled unless they are strictly necessary and their destinations are validated. -
Validate the destination immediately before every authenticated request rather than relying solely on initialization-time checks.
-
Rotate any API key that may have been used while
DDT_OPEN_BASEwas controlled by an untrusted environment, and review API usage logs for anomalous requests.
