T09 · Insecure Skill Coding Practices
- Location
src/config.js:17- Finding
Bearer credentials and account data are transmitted over plaintext HTTP by default
- Content
View full analysis
Vulnerability Details
File Location:
src/config.js:17-20,src/client.js:53-70,cli.js:329-332
Vulnerability Type: Cleartext transmission of sensitive information
Risk Level: HighTechnical Analysis
The built-in service endpoint uses plaintext HTTP:
js // Server certificate is not ready, so HTTP remains the default. const DEFAULT_BASE_URL = 'http://st.aidata366.com';Authenticated API requests attach the account bearer token to requests sent to that endpoint:
js res = await fetch(this.baseUrl + '/api/v1' + apiPath, { method, headers: { ...(body ? { 'Content-Type': 'application/json' } : {}), ...(this.token ? { Authorization: `Bearer ${this.token}` } : {}), ...headers, }, body: body ? JSON.stringify(body) : undefined, signal: ctrl.signal, });Export downloads also attach the token directly:
js const res = await fetch(url, { headers: { Authorization: `Bearer ${cfg.token}` }, signal: dlCtrl.signal });The client prints a warning when a token is used over HTTP, but the warning does not interrupt the request:
js if (!_httpWarned && this.token && this.baseUrl.startsWith('http://')) { _httpWarned = true; process.stderr.write('[warn] Current service address is plaintext HTTP...\n'); }Consequently, ordinary authenticated commands using the default configuration expose bearer credentials, request bodies, task results, and exports without transport confidentiality or server authentication.
Attack Path
- The user registers or logs in, and the resulting bearer token is saved locally.
- The user or agent invokes an authenticated command such as
quota,collect,query,export, orlogout. - Unless the user has explicitly replaced the default URL, the client connects to
http://st.aidata366.com. - The client includes
Authorization: Bearer ...in the plaintext request.
...[truncated 891 chars]
- Remediation
View remediation
Remediation Suggestions
- Replace the default endpoint with an HTTPS URL backed by a valid, hostname-matching certificate.
- Refuse to send bearer tokens over HTTP by default.
- If plaintext HTTP is required for local development, restrict it to loopback destinations or require an explicit, per-invocation unsafe override.
- Do not allow a persisted insecure setting to silently authorize future transmission of credentials.
- Keep TLS certificate verification enabled. Do not use
NODE_TLS_REJECT_UNAUTHORIZED=0as the normal alternative to fixing the certificate. - After deploying HTTPS, revoke or rotate tokens that may previously have traversed untrusted networks over HTTP.
