T09 · Insecure Skill Coding Practices
- Location
scripts/api/gigyaClient.ts:19- Finding
Blueair Account Password Transmitted in the URL Query String
- Content
View full analysis
{ const params = new URLSearchParams({ apiKey: this.api_key, loginID: this.username, password: this.password, targetEnv: 'mobile', }); const response = await this.apiCall('/accounts.login', params.toString()); ``` ```ts private async apiCall(url: string, data: string, retries = 3): Promise { const maxRetries = retries; try { const response = await fetch(`${this.gigyaApiUrl}${url}?${data}`, { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded', Accept: '*/*', }, }); ``` Equivalent generated code is also present in: - `scripts/api/gigyaClient.js` - `dist/api/gigyaClient.js` ### Technical Analysis The login request includes the user's email address and plaintext password in a `URLSearchParams` value and appends that value to the request URL. Although the request uses HTTPS, TLS only protects data while it is in transit. It does not prevent the complete URL from being captured by: - Reverse-proxy or endpoint access logs - HTTP tracing and application-performance monitoring systems - Debugging instrumentation - Error telemetry - Network security products that terminate TLS - Request-history or diagnostic tooling The request declares `application/x-www-form-urlencoded`, but the form data is not placed in the POST body. As a result, the password is unnecessarily exposed in the URL. Sending credentials to Gigya is necessary for the declared Blueair authentication functionality. Sending the password as a URL query parameter, however, exceeds the minimum safe exposure required for that functionality. ...[truncated 1193 chars]- Remediation
View remediation
