Skip to main content
CVE Vulnerability Database

CVE-2024-0297: Totolink N200RE Firmware RCE Vulnerability

CVE-2024-0297 is a critical remote code execution vulnerability in Totolink N200RE Firmware affecting version 9.3.5u.6139_B20201216. This article covers the technical details, affected versions, security impact, and mitigation.

Updated:

CVE-2024-0297 Overview

CVE-2024-0297 is an OS command injection vulnerability affecting Totolink N200RE router firmware version 9.3.5u.6139_B20201216. The flaw resides in the UploadFirmwareFile function of /cgi-bin/cstecgi.cgi, where the FileName argument is passed to a shell context without sanitization. Remote attackers can inject arbitrary operating system commands over the network without authentication. The exploit details have been publicly disclosed under VulDB identifier VDB-249863. The vendor was contacted prior to disclosure but did not respond, leaving deployed devices exposed. This issue is categorized under [CWE-78] (Improper Neutralization of Special Elements used in an OS Command).

Critical Impact

Unauthenticated remote attackers can execute arbitrary OS commands on affected Totolink N200RE routers, leading to full device compromise.

Affected Products

  • Totolink N200RE Firmware version 9.3.5u.6139_B20201216
  • Totolink N200RE hardware device
  • Deployments running the unpatched cstecgi.cgi web interface

Discovery Timeline

  • 2024-01-08 - CVE-2024-0297 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2024-0297

Vulnerability Analysis

The vulnerability exists in the firmware upload handler exposed by the Common Gateway Interface (CGI) endpoint /cgi-bin/cstecgi.cgi. The UploadFirmwareFile function processes the FileName parameter supplied by the client and passes it into an OS command invocation without applying input validation or sanitization. An attacker who can reach the router's web management interface can craft a request that appends shell metacharacters to the FileName value. The injected commands execute with the privileges of the web server process, which on consumer router firmware typically runs as root. Successful exploitation provides full read, write, and configuration control over the device.

Root Cause

The root cause is improper neutralization of special elements used in an OS command [CWE-78]. The UploadFirmwareFile handler concatenates user-controlled input directly into a shell command line. No allow-list, escaping routine, or parameterized API separates data from command syntax.

Attack Vector

The attack vector is network-based and requires no authentication or user interaction. An attacker sends an HTTP POST request to /cgi-bin/cstecgi.cgi with a manipulated FileName parameter containing shell metacharacters such as backticks, semicolons, or command substitution sequences. Public proof-of-concept material is available in the GitHub PoC Repository and the VulDB entry #249863.

No verified exploit code is reproduced here. Refer to the linked technical references for the disclosed request structure and parameter format.

Detection Methods for CVE-2024-0297

Indicators of Compromise

  • HTTP POST requests to /cgi-bin/cstecgi.cgi containing shell metacharacters (;, |, &, `, $()) in the FileName parameter
  • Unexpected outbound connections originating from the router management plane to attacker-controlled hosts
  • New or modified files in firmware writable partitions, particularly added cron entries or startup scripts
  • Unauthorized accounts or modified credentials in router configuration backups

Detection Strategies

  • Inspect web server and CGI access logs on the router for requests targeting UploadFirmwareFile with non-standard FileName values
  • Deploy network intrusion detection signatures that flag command injection patterns in HTTP request bodies to cstecgi.cgi
  • Monitor router DNS queries and outbound traffic for anomalies indicating post-exploitation command-and-control activity

Monitoring Recommendations

  • Centralize syslog from network devices to a SIEM and alert on configuration changes outside maintenance windows
  • Baseline expected administrative traffic to the router and alert on management requests from non-trusted source IP addresses
  • Track firmware version inventory across deployed Totolink devices to identify hosts on the vulnerable build

How to Mitigate CVE-2024-0297

Immediate Actions Required

  • Remove affected Totolink N200RE devices from untrusted networks until a vendor patch is available
  • Restrict access to the router web management interface to trusted internal management subnets only
  • Disable remote (WAN-side) administration on all Totolink N200RE devices
  • Rotate any credentials and pre-shared keys that may have been exposed through the router

Patch Information

No vendor patch has been published. The Totolink vendor did not respond to disclosure outreach, and no fixed firmware version is listed in the advisory. Organizations should monitor the VulDB entry and the Totolink vendor support channels for future updates, and evaluate replacement of unsupported hardware where a fix is not forthcoming.

Workarounds

  • Place the router behind a network segment that blocks inbound HTTP/HTTPS access to the management interface from untrusted sources
  • Apply firewall rules upstream of the device to drop external traffic destined for the management port
  • Consider replacing the affected hardware with a supported router that receives current security updates

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.