T09 · Insecure Skill Coding Practices
- Location
references/30-capability/harness-integration.md:213- Finding
Unauthenticated HTTP Endpoint Exposes Session-Derived Topic Data
- Content
View full analysis
webServer.register({ kind: 'exact', path: '/api/my-plugin/topics', handler(_req, res) { res.writeHead(200, { 'Content-Type': 'application/json' }) res.end(JSON.stringify(engine.getLatestTopics(sessionId))) }, })) } ``` ### Technical Analysis The documented HTTP handler returns session-derived topic data without authenticating the requester or verifying that the requester is authorized to access the referenced session. The request object is explicitly ignored, while `sessionId` is obtained from an ambient scope rather than from a trusted, authenticated server-side identity. The related client documentation states that these HTTP endpoints can be accessed using same-origin `fetch()` and that the `trustedHosts` restriction does not apply to ordinary HTTP requests. Same-origin routing is not an authorization mechanism. It does not protect the endpoint from: - Other components executing under the same origin. - A compromised or malicious client plugin. - Unauthorized local clients that can connect to the web server. - Remote clients if the server is bound or forwarded beyond localhost. - Cross-site request attacks where ambient cookie credentials are accepted. No request method restriction, session ownership validation, authentication check, or CSRF protection is shown. ### Attack Path 1. A developer follows the documented example and registers `/api/my-plugin/topics`. 2. The plugin reads topics derived from a DSH conversation session. 3. An unauthorized client, malicious same-origin plugin, or reachable local process requests the endpoint. 4. The handler ignores ...[truncated 904 chars]- Remediation
View remediation
