Totolink N300RH Buffer Overflow Vulnerability (CVE-2026-7750)
A buffer overflow vulnerability exists in Totolink N300RH 3.2.4-B20220812 allowing remote attackers to execute arbitrary code by manipulating the mac_address argument in the setMacFilterRules function of the /cgi-bin/cstecgi.cgi POST request handler.
A buffer overflow vulnerability, identified as CVE-2026-7750, affects Totolink N300RH router version 3.2.4-B20220812. The vulnerability resides in the setMacFilterRules function within the /cgi-bin/cstecgi.cgi file, which handles POST requests. Attackers can exploit this flaw by sending a specially crafted POST request with an overly long mac_address parameter, triggering a buffer overflow. Successful exploitation allows for arbitrary code execution on the device. The vulnerability is remotely exploitable, and a public exploit is available, increasing the risk of widespread attacks. Defenders should prioritize patching or mitigating this vulnerability to prevent potential compromise of affected devices.
Attack Chain
- The attacker identifies a vulnerable Totolink N300RH router running firmware version 3.2.4-B20220812.
- The attacker crafts a malicious POST request targeting the
/cgi-bin/cstecgi.cgiendpoint. - Within the POST request, the attacker includes the
mac_addressparameter, injecting a string longer than the buffer allocated for it. - The
setMacFilterRulesfunction processes the POST request without proper bounds checking on themac_addressargument. - The overly long
mac_addressvalue overflows the buffer, overwriting adjacent memory regions. - The attacker carefully crafts the overflow to overwrite the return address, redirecting execution flow to attacker-controlled code.
- The injected code executes with the privileges of the web server, allowing the attacker to execute arbitrary commands.
- The attacker gains complete control over the router, potentially using it for further malicious activities such as network pivoting, data exfiltration, or denial-of-service attacks.
Impact
Successful exploitation of CVE-2026-7750 allows a remote attacker to execute arbitrary code on the vulnerable Totolink N300RH device. This could lead to a complete compromise of the router, allowing the attacker to control network traffic, steal sensitive information, or use the router as a bot in a larger attack. Given the public availability of the exploit, a large number of unpatched devices could be vulnerable to automated attacks, potentially impacting thousands of users.
Recommendation
- Apply available patches or firmware updates provided by Totolink to address CVE-2026-7750.
- Implement network intrusion detection system (IDS) rules to detect and block suspicious POST requests targeting the
/cgi-bin/cstecgi.cgiendpoint with excessively longmac_addressparameters. - Deploy the Sigma rules in this brief to your SIEM to detect exploitation attempts.
- Monitor web server logs for unusual POST requests to
/cgi-bin/cstecgi.cgi, focusing on requests with largemac_addressvalues.
Detection coverage 2
Detect Suspiciously Long MAC Address in POST Request to Totolink CGI
highDetects abnormally long mac_address parameters in POST requests to cstecgi.cgi, indicative of a buffer overflow attempt in Totolink devices.
Detect Access to Totolink cstecgi.cgi Endpoint
mediumDetects access to the cstecgi.cgi endpoint, which is known to be vulnerable on Totolink devices.
Detection queries are kept inside the platform. Get full rules →