T09 · Insecure Skill Coding Practices
Error
- Location
- server/server.py:82
- Finding
- Local Skill Data Exposed Through All-Interface Binding and Permissive CORS<![CDATA[ ## Vulnerability Details **File Location**: `server/server.py:82-89, 96-101, 119-124` **Vulnerability Type**: Unauthenticated network exposure and overly permissive cross-origin access **Risk Level**: High ### Complete Code Snippet ```python def do_OPTIONS(self): self.send_response(200) self.send_header("Access-Control-Allow-Origin", "*") self.send_header("Access-Control-Allow-Methods", "GET, OPTIONS") self.send_header("Access-Control-Allow-Headers", "Content-Type") self.end_headers() def do_GET(self): parsed = urlparse(self.path) if parsed.path == "/api/skills": self.send_response(200) self.send_header("Content-Type", "application/json") self.send_header("Access-Control-Allow-Origin", "*") self.end_headers() self.wfile.write(json.dumps(get_all_skills()).encode()) return ``` ```python def main(): port = 8765 import webbrowser webbrowser.open(f"http://localhost:{port}/") server = HTTPServer(("0.0.0.0", port), Handler) print("Skills Browser: http://127.0.0.1:" + str(port)) server.serve_forever() ``` ### Technical Analysis The Skill documentation describes access through `127.0.0.1`, which implies a local-only service. The implementation instead binds the HTTP server to `0.0.0.0`, making it listen on every available network interface. The API has no authentication or session authorization. It also returns `Access-Control-Allow-Origin: *`, allowing arbitrary web origins to request and read API responses where browser networking policy permits. These permissions are unnecessary for a local Skill browser whose frontend and API share the same origin. The API exposes Skill metadata and complete `SKILL.md` contents. Consequently, the network exposure and wildcard CORS exceed the minimum privileges required for the declared local browsing functionality. ### Attack Path 1. A user launches the Skill. 2. The HTTP server begins listening on port 8765 on al ...[truncated 975 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Bind the server exclusively to the loopback interface: ```python server = HTTPServer(("127.0.0.1", port), Handler) ``` 2. Remove `Access-Control-Allow-Origin: *`. The bundled frontend and API use the same origin and do not require CORS. 3. If cross-origin access is genuinely required, allow only an explicit trusted origin and validate the `Origin` header. 4. Validate the `Host` header to reduce DNS-rebinding exposure. 5. Consider generating a random per-launch authorization token and requiring it for API requests. 6. Add response security headers, including a restrictive Content Security Policy. 7. Document the actual network binding and security boundary accurately. ]]>
