Bug Report: Hotspot Captive Portal Crash on Malformed HTTP Request (v7.19.3)

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.

This can be considered a security issue (Denial-of-Service from unauthenticated user in public facing, untrusted environment), so follow this MikroTik Routers and Wireless - Security to report the issue to MikroTik (send email to security@mikrotik.com).

See @normis' reply related to an on-going vulnerability:

Also, upgrade to the latest stable version first (7.19.6) and retest your finding before filling the report.

Thank you for your recommendation. :+1:
:white_check_mark: Upgraded to 7.20 and tested again.
:white_check_mark: contacted support via email.