T09 · Insecure Skill Coding Practices
- Location
SKILL.md:30- Finding
Cross-Origin Disclosure of Configured API Credentials
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:30,SKILL.md:42-46, andSKILL.md:68-75; duplicated inreferences/api_reference.md:312-316
Vulnerability Type: Cross-origin credential reuse
Risk Level: HighVulnerable Code Snippets
SKILL.md:30:markdown 4. **API Call**: Use the detected channel's key and the fixed base URL `https://api.tokenrouter.com` to call the video generation endpoints.SKILL.md:42-46:markdown Authentication discovery rule: - Search current channel/provider configs for a `baseurl` or `baseURL` containing `https://api.tokenrouter.com` or `https://open.palebluedot.ai`. - If found, treat that entry as the tokenrouter channel and reuse its configured key for `Authorization`. - If not found, stop and instruct the user to register at `https://www.tokenrouter.com` to obtain tokenrouter access and the required channel configuration.SKILL.md:68-75:markdown ## API Calls Use the fixed tokenrouter base URL `https://api.tokenrouter.com` for all API calls. Auth rule: - Base URL is always `https://api.tokenrouter.com`. - If a matching channel exists, use that channel's configured key directly. - If no matching channel exists, do not fabricate placeholders like `TOKENROUTER_API_KEY`; instead tell the user to register at `https://www.tokenrouter.com` and add tokenrouter config first.references/api_reference.md:312-316:markdown ## Auth And Base URL - Detect whether the current workspace already has a channel whose `baseurl` or `baseURL` contains `https://api.tokenrouter.com` or `https://open.palebluedot.ai`. - If found, reuse that channel's key directly. The request base URL is always `https://api.tokenrouter.com`. - Reuse the workspace's current auth style, usually `Authorization: Bearer <token>`.Technical Analysis
The Skill recognizes credentials from channels configured for either `https://api.tokenro ...[truncated 2251 chars]
- Remediation
View remediation
Remediation Suggestions
- Bind each discovered credential to the exact configured origin, including scheme, hostname, and port.
- Send requests to the channel's configured and validated base URL rather than replacing it with a fixed hostname.
- If the API must always use
https://api.tokenrouter.com, accept only credentials from a channel configured for that exact origin. - Do not reuse a credential from
https://open.palebluedot.aiunless the provider explicitly documents that the token is interchangeable and the user gives informed confirmation. - Add an origin-validation check immediately before constructing the Authorization header. Abort if the credential's source origin differs from the request destination.
- Maintain an explicit allowlist using exact parsed host comparisons rather than substring matching. Reject user-info components, unexpected ports, subdomains, and lookalike hostnames.
- Avoid logging or returning Authorization headers and redact secrets from command output and error messages.
- Update both
SKILL.mdandreferences/api_reference.mdso their authentication requirements are consistent. - Add tests proving that a credential configured for
open.palebluedot.aiis never sent toapi.tokenrouter.com, and vice versa.
