I've encountered a critical issue where the Hotspot Captive Portal crashes or becomes unresponsive when processing a specific malformed HTTP request from a client device before authentication. This results in service disruption and requires a manual RouterBoard reboot.
1. Affected System Details
- RouterBOARD Model: CCR2116
- RouterOS Version: 7.19.3
- Feature: Hotspot / Captive Portal
2. Symptoms and Root Cause
- Symptom: The captive portal service crashes immediately. The Router's CPU utilization gets stuck at a constant, elevated value (observed: 6% or 11%), indicating an unhandled exception in the Hotspot service.
- Cause: The crash is triggered when the Hotspot attempts to redirect a malformed HTTP request (from a client's VPN app) to the login page. The captive portal web server appears to fail when parsing the irregular HTTP headers.
3. Malformed Request Details (Wireshark)
The issue is triggered by a highly irregular POST request structure containing multiple/malformed Host headers:
| Field | Value/Observation | Note |
|---|---|---|
| Request Method | POST |
|
| Host Header 1 | Host : speed.cloudflare.com\r\n |
Illegal characters found in header name (Space before colon) |
| Host Header 2 | Host: de2.trafficrevelation.download\r\n |
Contains two separate Host headers. |
| Cookie Header | Cookie: Host:speed.cloudflare.com\r\n |
4. Temporary Workaround
I've temporarily solved the issue by using the IP > Hotspot > Walled Garden feature to allow the specific destination domain that the offending client traffic was trying to reach. This prevents the traffic from hitting the captive portal redirect logic.
5. Request for Fix
Please investigate improving the robustness of the Hotspot Captive Portal web server to gracefully handle and reject malformed HTTP requests (specifically header parsing) without crashing the service.