T09 · Insecure Skill Coding Practices
- Location
captcha.js:90- Finding
CAPTCHA API Key Exposed in URL Query Strings
- Content
View full analysis
Vulnerability Details
File Location:
captcha.js:90-98,captcha.js:110-117, andcaptcha.js:139-145
Vulnerability Type: Sensitive credential exposure through request URLs
Risk Level: MediumVulnerable Code
js // Submit captcha const submitParams = new URLSearchParams({ key: this.apiKey, method, json: 1, ...params, }); const submitRes = await fetch(`https://2captcha.com/in.php?${submitParams}`); const submitData = await submitRes.json();js const resultParams = new URLSearchParams({ key: this.apiKey, action: 'get', id: captchaId, json: 1, }); const resultRes = await fetch(`https://2captcha.com/res.php?${resultParams}`); const resultData = await resultRes.json();js const params = new URLSearchParams({ key: this.apiKey, action: 'reportbad', id: captchaId, }); await fetch(`https://2captcha.com/res.php?${params}`);Technical Analysis
The user-supplied CAPTCHA API key is embedded directly into the query string of multiple GET requests. Sending the key to the selected CAPTCHA provider is necessary for the declared functionality, but transmitting it as part of a URL is not a least-exposure design.
TLS protects the URL while it is in transit between the client and the HTTPS server. It does not prevent the complete URL from being retained by the destination's access logs, reverse proxies, debugging systems, network monitoring products, exception reports, or local instrumentation. Query parameters are also commonly recorded more broadly than request bodies or authorization headers.
This issue affects submission, result polling, and bad-result reporting, repeatedly exposing the same credential in generated request URLs.
Attack Path
- The user places a funded CAPTCHA service key in
CAPTCHA_API_KEYor passes it toCaptchaSolver. - The Skill embeds that key in the
keyquery parameter. - The complete re ...[truncated 848 chars]
- The user places a funded CAPTCHA service key in
- Remediation
View remediation
Remediation Suggestions
- Use the provider's POST API where supported.
- Place the API key in an authorization header or POST body rather than the URL.
- Configure HTTP clients, proxies, and diagnostics to redact credentials.
- Avoid including complete request URLs in exceptions or application logs.
- Add automated tests that fail if
CAPTCHA_API_KEYappears in a generated URL. - Document key rotation and revocation procedures for users who suspect exposure.
- If compatibility requires query authentication, explicitly warn users of the logging exposure and recommend a dedicated, low-balance key.
