Totolink N300RH Stack-Based Buffer Overflow Vulnerability (CVE-2026-10187)
A stack-based buffer overflow vulnerability, CVE-2026-10187, exists in the setWiFiBasicConfig function of the wireless.so file in the Web Management Interface of Totolink N300RH version 6.1c.1353_B20190305, allowing a remote attacker to execute arbitrary code by manipulating the KeyStr argument.
A stack-based buffer overflow vulnerability has been identified in Totolink N300RH router, version 6.1c.1353_B20190305. The vulnerability resides in the setWiFiBasicConfig function within the wireless.so file, a component of the device's web management interface. Publicly available exploits demonstrate that a remote attacker can leverage this vulnerability by manipulating the KeyStr argument passed to the vulnerable function, resulting in arbitrary code execution on the device. The affected version was released in March 2019, suggesting that many devices are potentially vulnerable due to lack of updates. This poses a significant risk, as successful exploitation could allow attackers to gain full control of the router, compromise connected devices, and intercept network traffic.
Attack Chain
- The attacker identifies a vulnerable Totolink N300RH router running firmware version 6.1c.1353_B20190305.
- The attacker sends a crafted HTTP request to the router's web management interface.
- The HTTP request targets the
setWiFiBasicConfigfunction. - The request includes a malicious payload in the
KeyStrargument, designed to overflow the stack buffer. - The
wireless.solibrary processes the request without proper bounds checking on theKeyStrargument. - The buffer overflow overwrites critical memory regions, including the return address.
- Upon returning from the function, execution jumps to the attacker-controlled address, allowing for arbitrary code execution.
- The attacker gains a shell on the router and can perform malicious actions.
Impact
Successful exploitation of CVE-2026-10187 can lead to full compromise of the Totolink N300RH router. Attackers can leverage this access to intercept network traffic, modify DNS settings, create backdoors, and potentially compromise other devices on the network. Due to the high CVSS score (9.8), the impact is considered critical, allowing for complete control over the affected device. Given the nature of routers as network gateways, this vulnerability can serve as an entry point for wider attacks on home or small business networks.
Recommendation
- Deploy the Sigma rule
Detect CVE-2026-10187 Exploitation Attempt via Long KeyStrto identify suspicious HTTP requests targeting thesetWiFiBasicConfigfunction with abnormally longKeyStrarguments. - Block or investigate any traffic to the
setWiFiBasicConfigendpoint originating from unexpected IP addresses, based on observed network connections. - Monitor webserver logs for POST requests to the
setWiFiBasicConfigendpoint, based on webserver log source.
Detection coverage 2
Detect CVE-2026-10187 Exploitation Attempt via Long KeyStr
highDetects CVE-2026-10187 exploitation attempt by monitoring for HTTP POST requests to setWiFiBasicConfig with excessively long KeyStr values, indicating a potential buffer overflow attempt.
Detect CVE-2026-10187 Exploitation Attempt via setWiFiBasicConfig
mediumDetects CVE-2026-10187 exploitation attempt by monitoring HTTP POST requests to the web management interface specifically targeting the `setWiFiBasicConfig` function in the wireless settings.
Detection queries are available on the platform. Get full rules →