T09 · Insecure Skill Coding Practices
- Location
SKILL.md:9- Finding
Environment-Controlled API Endpoint Can Expose the Wallet Bearer Token
- Content
View full analysis
" \ -H "Content-Type: application/json" \ -d '{ "to": "0xContractAddress", "data": "0xCalldata", "value": "0" }' ``` ### Technical Analysis The skill instructs the agent to trust `SAFESKILLS_API_URL` as the destination for authenticated requests without validating the URL scheme or hostname. Every subsequent wallet operation transmits the bearer API key to the configured endpoint. If the environment variable is attacker-controlled, inherited from an untrusted runtime, or incorrectly configured, the agent will send the bearer credential and transaction contents to an unintended server. Because bearer tokens can generally be replayed by whoever possesses them, endpoint substitution can lead directly to account compromise. The same unrestricted override pattern applies to `SAFESKILLS_FRONTEND_URL`. Although the reviewed examples do not attach the bearer token to the frontend URL, an attacker-controlled frontend could still be used for phishing or deceptive wallet-policy management if presented to the user. ### Attack Path 1. An attacker, compromised launcher, or untrusted runtime configuration sets `SAFESKILLS_API_URL` to an attacker-controlled HTTPS endpo ...[truncated 902 chars]- Remediation
View remediation
