T09 · Insecure Skill Coding Practices
- Location
config.ts:39- Finding
Sensitive conversation data and bearer tokens may be transmitted over insecure or untrusted HTTP endpoints
- Content
View full analysis
Vulnerability Details
File Location:
config.ts:21-21,config.ts:39-42,index.ts:56-60,index.ts:66-75, andindex.ts:93-102
Vulnerability Type: Insufficient URL and transport security validation
Risk Level: MediumVulnerable Code
ts const DEFAULT_SERVER_URL = "http://localhost:8790";ts const serverUrl = typeof cfg.serverUrl === "string" ? resolveEnvVars(cfg.serverUrl) : DEFAULT_SERVER_URL; const apiKey =ts private buildHeaders(withBody = false): Record<string, string> { const headers: Record<string, string> = { Accept: "application/json" }; if (withBody) headers["Content-Type"] = "application/json"; if (this.apiKey) headers["Authorization"] = `Bearer ${this.apiKey}`; return headers; }ts const res = await fetch(`${this.baseUrl}/memories/search`, { method: "POST", headers: this.buildHeaders(true), body: JSON.stringify(body), });ts const res = await fetch(`${this.baseUrl}/memories/`, { method: "POST", headers: this.buildHeaders(true), body: JSON.stringify(body), });Technical Analysis
The configuration parser accepts
serverUrlas an arbitrary string and does not parse or validate its protocol, hostname, port, embedded credentials, or destination. The HTTP client then directly appends fixed paths to that value and sends requests containing:- Agent prompts used as semantic-search queries.
- User messages selected for automatic capture.
- The configured API key in an
Authorization: Bearerheader. - The configured user or namespace identifier.
An
http://endpoint provides no transport confidentiality or integrity. If it is remote or traffic leaves a trusted loopback boundary, an on-path attacker can read conversation data and bearer credentials or manipulate responses. Because arbitrary destinations are accepted, a party capable of changing plugin configuration can al ...[truncated 1947 chars]- Remediation
View remediation
Remediation Suggestions
- Parse the configured value with the standard
URLclass before constructing the client. - Permit only
https:for non-loopback destinations. - Permit
http:only for explicit loopback hosts such as127.0.0.1,[::1], or a carefully validatedlocalhost. - Reject unsupported schemes, embedded URL credentials, fragments, and malformed URLs.
- Consider an administrator-controlled hostname or CIDR allowlist to prevent requests to arbitrary internal services.
- Disable redirects or validate every redirect destination before forwarding sensitive headers.
- Do not forward the bearer token across origins during redirects.
- Emit a clear configuration error instead of silently accepting an insecure remote endpoint.
- Document that remote AgentMemo deployments require TLS with certificate validation.
- Consider separate credentials with least-privilege search and write permissions, limiting the effect of token disclosure.
- Parse the configured value with the standard
