T09 · Insecure Skill Coding Practices
- Location
scripts/reminder-client.mjs:16- Finding
Bearer Token and Reminder Data May Be Sent Over an Untrusted Plaintext Connection
- Content
View full analysis
Vulnerability Details
File Location:
scripts/reminder-client.mjs:16-25, 92-102
Vulnerability Type: Insufficient API endpoint and transport validation
Risk Level: HighVulnerable Code
js const baseUrl = process.env.REMINDER_API_BASE_URL?.trim(); const token = process.env.REMINDER_API_TOKEN?.trim(); if (!baseUrl) { fail("Missing REMINDER_API_BASE_URL."); } if (!token) { fail("Missing REMINDER_API_TOKEN."); }js async function requestJson(pathname, init) { const url = new URL(pathname, ensureTrailingSlash(baseUrl)); const response = await fetch(url, { ...init, headers: { authorization: `Bearer ${token}`, accept: "application/json", ...init?.headers, }, }); const bodyText = await response.text(); if (!response.ok) { const message = bodyText ? `Request failed with ${response.status}: ${bodyText}` : `Request failed with ${response.status}.`; fail(message); } printBody(bodyText); }Technical Analysis
The client verifies only that
REMINDER_API_BASE_URLis present. It does not enforce HTTPS, restrict plaintext HTTP to loopback development endpoints, reject embedded URL credentials, or establish that the destination belongs to the intended reminder service.Every request adds
REMINDER_API_TOKENas a bearer credential. Create operations also transmit the complete caller-supplied JSON body, which may contain private fields such astitle,notes,location,url,start_at, and rawsource_text.Network transmission is necessary for the Skill's declared remote reminder functionality. The vulnerability is therefore not the transmission itself, but the absence of minimum transport and destination controls around sensitive transmissions. The configuration guidance permits HTTP for local development, but the implementation does not constrain HTTP to loopback destinations.
...[truncated 1258 chars]
- Remediation
View remediation
Remediation Suggestions
- Parse and validate
REMINDER_API_BASE_URLbefore processing any command. - Require the
https:scheme for every non-loopback destination. - Allow
http:only for explicitly recognized loopback hosts such aslocalhost,127.0.0.1, and[::1]. - Reject unsupported schemes, malformed ports, fragments, query strings, and URLs containing embedded usernames or passwords.
- Consider a trusted-origin allowlist or require explicit confirmation when the configured API origin changes.
- Prevent credential leakage through redirects by disabling automatic redirects or manually validating every redirect destination before resending the authorization header.
- Document that the bearer token must only be sent to a trusted reminder worker over authenticated TLS.
- Minimize transmitted personal data by omitting optional fields such as
source_text,notes, orlocationunless required by the user. - Add automated tests confirming rejection of remote HTTP endpoints, non-HTTP schemes, embedded credentials, and redirects to untrusted origins.
- Parse and validate
