T09 · Insecure Skill Coding Practices
- Location
src/config.js:24- Finding
Bearer Token and Sensitive API Data Transmitted over Plaintext HTTP by Default
- Content
View full analysis
Vulnerability Details
File Location:
src/config.js:24, with authenticated request sinks atsrc/client.js:66-73andcli.js:299-300
Vulnerability Type: Plaintext transmission of credentials and sensitive data
Risk Level: HighTechnical Analysis
The Skill configures a plaintext HTTP service as its default API endpoint:
js const DEFAULT_BASE_URL = 'http://st.aidata366.com';The API client attaches the persistent bearer token to requests made 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, });The export download path likewise transmits the token to the configured endpoint:
js const res = await fetch(`${cfg.baseUrl}/api/v1/platform/exports/${encodeURIComponent(info.export_id)}/file`, { headers: { Authorization: `Bearer ${cfg.token}` }, signal: dlCtrl.signal });The documentation acknowledges that the default address is plaintext and that the token will cross the public network without encryption. The implementation emits a warning to stderr, but it neither blocks the request nor requires explicit confirmation. Consequently, authenticated commands use plaintext transport unless the user proactively changes the endpoint.
This is a reachable vulnerability rather than evidence of deliberate credential theft: the token is sent to the service used by the Skill, but the transport does not protect it against network interception or modification.
Attack Path
- The user completes login or registration, and the resulting bearer token is saved locally.
- The user or agent invokes an authenticated command such as
quota,submit,query,export, orlogout. - Unless explicitl ...[truncated 1121 chars]
- Remediation
View remediation
Remediation Suggestions
- Provision a valid TLS certificate and change the default endpoint to an
https://URL. - Reject authenticated requests to non-HTTPS endpoints rather than merely printing a warning.
- If plaintext HTTP is necessary for local development, restrict it to loopback addresses such as
127.0.0.1,localhost, or::1. - Require a narrowly scoped, explicit per-invocation override before allowing credentials over any other HTTP endpoint.
- Apply the HTTPS requirement consistently to ordinary API calls and direct export downloads.
- Avoid process-wide TLS bypasses for production use. If custom certificates are required, support a scoped custom CA configuration instead of disabling certificate verification.
- After deploying HTTPS, revoke or rotate tokens that may previously have traversed plaintext networks.
- Provision a valid TLS certificate and change the default endpoint to an
