T09 · Insecure Skill Coding Practices
- Location
bin/run.mjs:228- Finding
API Credential Transmitted in the URL Query String
- Content
View full analysis
parameter.name === "token"); if (!tokenParam || params.token !== undefined) { return; } if (!cliToken) { fail("--token is required for this operation.", { operationId: operation.operationId, }); } params.token = cliToken; } ``` ```js function applyQueryParams(operation, params, url) { for (const parameter of operation.parameters.filter((item) => item.location === "query")) { const value = params[parameter.name]; if (value === undefined) { continue; } appendValue(url.searchParams, parameter.name, value); } } ``` The resulting URL contains the credential in a form equivalent to: ```text https://api.justoneapi.com/api/youku/search-video/v1?token=SECRET&keyword=... ``` ### Technical Analysis The Skill must authenticate to the declared JustOneAPI endpoint, so transmitting a credential to that service is functionally necessary. However, placing the credential in the URL is not the minimum safe disclosure mechanism. HTTPS protects the URL while it is in transit, but it does not prevent the complete URL from being recorded at either endpoint or by infrastructure that terminates TLS. Query strings are commonly retained by: - API gateway and reverse-proxy access logs - Server request logs - Application performance monitoring and distributed tracing ...[truncated 1693 chars]- Remediation
View remediation
