T09 · Insecure Skill Coding Practices
Error
- Location
- references/setup-guide.md:231
- Finding
- Unauthenticated Plaintext Access to Camera Images and Live Streams<![CDATA[ ## Vulnerability Details **File Location**: `references/setup-guide.md`, lines 231–235 **Vulnerability Type**: Missing authentication and transport security **Risk Level**: High ### Vulnerable Code ```cpp config.server_port = 80; if (httpd_start(&camera_httpd, &config) == ESP_OK) { httpd_uri_t u1 = { .uri = "/", .method = HTTP_GET, .handler = index_handler }; httpd_uri_t u2 = { .uri = "/capture", .method = HTTP_GET, .handler = capture_handler }; httpd_uri_t u3 = { .uri = "/stream", .method = HTTP_GET, .handler = stream_handler }; ``` ### Technical Analysis The generated firmware exposes the web interface, individual camera snapshots, and the live MJPEG stream over port 80 without any authentication or authorization checks. Requests are accepted solely based on network reachability. Because the service uses plaintext HTTP, camera content can also be observed or modified by an attacker with a suitable position on the network. The implementation does not require a password, API token, signed request, client certificate, or trusted source address before invoking the camera handlers. ### Attack Path 1. The victim flashes the documented firmware and connects the camera to a Wi-Fi or fallback access-point network. 2. An attacker obtains network reachability to the ESP32 device. 3. The attacker discovers the device through network scanning, DHCP information, mDNS, serial-output disclosure, or a known fixed address. 4. The attacker requests `http://<camera-ip>/capture` to retrieve snapshots or `http://<camera-ip>/stream` to receive a live video stream. 5. The server returns camera imagery without requesting credentials. 6. If the attacker can monitor local traffic, plaintext imagery may also be passively intercepted. ### Impact Assessment Any network-reachable attacker can obtain camera snapshots and continuous video. This can result in unauthorized surveillance and disclosure of people, physical locations, documents, screens, possessions, ...[truncated 234 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Require authentication for `/`, `/capture`, and `/stream`, using a strong device-specific secret or short-lived signed tokens. - Reject requests before acquiring a camera frame unless authorization succeeds. - Do not expose the camera directly to untrusted networks. - Place the device on a dedicated VLAN or isolated IoT network and restrict access with firewall rules. - Use a trusted TLS-terminating reverse proxy or gateway if HTTPS cannot be implemented safely on the device. - Avoid router port forwarding and Universal Plug and Play exposure. - Add request throttling and authentication-failure logging where device resources permit. - Document secure credential provisioning and rotation procedures. ]]>
