T09 · Insecure Skill Coding Practices
- Location
SKILL.md:24- Finding
Unvalidated API Base URL Can Expose the Bearer Credential
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 24–82
Vulnerability Type: Unvalidated credential destination
Risk Level: MediumThe Skill permits the API base URL to be supplied through the existing
DDT_OPEN_BASEenvironment variable. The documented requests then send theDDT_API_KEYbearer credential to that URL without validating its scheme or hostname.bash export DDT_API_KEY="ddt_live_xxxxxxxx" export DDT_OPEN_BASE="${DDT_OPEN_BASE:-https://gotoshop-ai.com/ddtclaw}"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 shell expansion preserves any preexisting value of
DDT_OPEN_BASE; the official endpoint is used only when the variable is unset or empty. No origin allowlist, HTTPS requirement, hostname check, or redirect policy is specified before the Authorization header is attached.Consequently, an attacker who can influence the execution environment could set
DDT_OPEN_BASEto an attacker-controlled server. Running any documented request would then transmit the bearer credential to that server. An HTTP endpoint could additionally expose the credential to network interception.This issue does not independently grant environment modification privileges. Exploitation requires prior influence over the environment or configuration used to launch the Skill.
Attack Path
- An attacker, compromised launcher, or unsafe env ...[truncated 924 chars]
- Remediation
View remediation
Remediation Suggestions
- Hard-code the production API origin when attaching production credentials, preferably
https://gotoshop-ai.com/ddtclaw. - If endpoint overrides are necessary, parse and validate the URL before making a request. Require HTTPS, an exact approved hostname, and an approved port and path prefix.
- Reject URLs containing user information, unexpected ports, or unapproved hosts.
- Prevent authenticated requests from following redirects to a different origin. Configure
curlnot to follow redirects, or explicitly validate every redirect destination before forwarding the Authorization header. - Use separate, minimally privileged test credentials for development endpoints rather than allowing production credentials to be sent to arbitrary override URLs.
- Sanitize inherited environment variables in launch scripts or controlled runtimes.
- Rotate the API key immediately if it may have been used while
DDT_OPEN_BASEpointed to an untrusted destination.
- Hard-code the production API origin when attaching production credentials, preferably
