T09 · Insecure Skill Coding Practices
- Location
SKILL.md:22- Finding
API Credential Disclosure Through an Unvalidated Endpoint
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 22-28
Vulnerability Type: Credential exposure through an unvalidated, environment-controlled API endpoint
Risk Level: HighComplete Code Snippet:
bash curl -s -X POST "$CLAW_API_BASE/api/scrape" \ -H "Content-Type: application/json" \ -d '{ "claw_key": "'"$CLAW_KEY"'", "url": "URL_HERE", "mode": "scraper" }'Technical Analysis
The Skill instructs the agent to transmit the secret
CLAW_KEYin the request body to an endpoint constructed fromCLAW_API_BASE. However, the documentation neither defines this variable nor validates its scheme or hostname before transmitting the credential.Authentication to the declared scraping service is necessary for the Skill's functionality, but allowing an unrestricted environment variable to control the credential's destination exceeds minimum privilege. An attacker who can influence the agent's environment or command context can set
CLAW_API_BASEto an attacker-controlled server. The documented command would then disclose both the API credential and the requested target URL.The
curl -soption suppresses progress and error messages, which may reduce the likelihood that a user notices an invalid or unexpected endpoint. The request body also places the key alongside ordinary application data rather than using a conventional authorization header.Attack Path
- An attacker or compromised configuration sets
CLAW_API_BASEto an attacker-controlled HTTP or HTTPS origin. - A user asks the agent to scrape a URL using the Skill.
- The agent follows the documented command without validating the endpoint.
curlsends theCLAW_KEYand requested URL to the attacker-controlled server.- The attacker captures the key and reuses it to access the paid scraping service until the credential is revoked or blocked.
Impact Assessment
Successful exploitation expose ...[truncated 635 chars]
- An attacker or compromised configuration sets
- Remediation
View remediation
Remediation Suggestions
- Define and pin the API endpoint to an explicit HTTPS origin controlled by the declared provider rather than relying on an unrestricted environment variable.
- If endpoint configurability is operationally required, parse and validate the URL before use. Require HTTPS, enforce an exact hostname allowlist, reject embedded credentials, and fail closed for missing or invalid values.
- Transmit the key through a standard authorization header, such as
Authorization: Bearer ..., and ensure the service and intermediary logs redact it. - Avoid silent failure during endpoint validation. Provide clear errors when the configured destination is absent or not approved without printing the credential.
- Warn users not to submit URLs containing credentials, session tokens, private resource identifiers, or other sensitive query parameters.
- Support prompt credential revocation and rotation after suspected exposure, despite the documented non-expiring nature of the key.
