Summary
Netis AC1200 Router NC21 V4.0.1.4296 contains an unauthenticated OS command injection vulnerability in the /cgi-bin/skk_set.cgi HTTP endpoint.
By abusing the password and new_pwd_confirm parameters, an attacker on the local network can execute arbitrary shell commands on the router with a single POST request, leading to full remote code execution.
Affected context
This vulnerability affects Netis AC1200 Router NC21 devices running firmware version V4.0.1.4296 where the web management interface exposes the /cgi-bin/skk_set.cgi endpoint.
The issue manifests when user-supplied POST parameters meant for password management are passed directly to the underlying OS shell without proper validation or escaping.
In typical deployments, any system on the same LAN segment that can reach the router's HTTP management port may be in a position to trigger the flaw, particularly when the interface is left at default access settings.
Exploit preconditions
- Attack surface: HTTP management interface at /cgi-bin/skk_set.cgi on the router.
- Required access: Network reachability to the router's web interface from the local network (LAN); no authentication or valid credentials are required.
- Trigger point: Sending an HTTP POST request that sets the
passwordand/ornew_pwd_confirmparameters to crafted values containing encoded shell commands. - Why exploitation is possible: The application concatenates the parameter values directly into a shell command and invokes it, allowing meta-characters and backtick substitution to be interpreted by the OS shell without sanitization or quoting.
Why this happens
The core issue is an OS command injection flaw as described by CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection').
The router's CGI script, skk_set.cgi, uses user-controlled POST parameters (password and new_pwd_confirm) when building shell commands that are executed by the operating system.
Instead of treating these fields strictly as data and validating or encoding them, the implementation allows shell metacharacters (such as backticks) to be processed by the interpreter.
The ability to encode and decode payloads (e.g., via base64) further helps bypass rudimentary filters, illustrating a general pattern where input is implicitly trusted and merged into command lines without robust neutralization.
Potential impact
- Full remote code execution on the router's underlying operating system.
- Installation of persistent malware or implants on the router.
- Interception, modification, or redirection of LAN and WAN traffic (e.g., DNS hijacking, man-in-the-middle setups).
- Use of the compromised router as a foothold for lateral movement inside the internal network.
- Inclusion of the device in botnets for DDoS attacks or further offensive operations.
- Exposure or tampering of router configuration, including credentials and network policies.
General mitigation guidance
Effective mitigation focuses on eliminating the ability for user input to influence shell command structure and on reducing what the router's web interface is allowed to do:
- Replace direct shell invocation with safer, parameterized APIs for system operations, avoiding generic command construction.
- Apply strict server-side validation and canonicalization to password-related parameters, allowing only expected character sets and lengths.
- Use robust escaping or safe wrappers when invoking system utilities, ensuring user input is never parsed as shell syntax.
- Apply the principle of least privilege to the web management process so that, if compromised, it has minimal access to the underlying system.
- Segregate or disable unnecessary CGI endpoints, and restrict management interface exposure to trusted administration networks only (e.g., dedicated VLAN, management segment).
- Introduce defense-in-depth measures such as command execution whitelists or capability-based wrappers around system utilities.
How teams detect issues like this
Detection typically combines code-level inspection with behavioral monitoring of the router firmware:
- Static analysis: Look for CGI or web handlers that construct shell commands using string concatenation or formatting functions with user-controlled parameters; flag calls to system(), popen(), exec*(), or similar APIs that include HTTP parameter values.
- Code review: Examine password-change and configuration endpoints for direct shell usage, lack of input validation, and reliance on shell metacharacters; ensure reviewers explicitly verify how parameters like
passwordandnew_pwd_confirmare processed. - Firmware analysis: Unpack router firmware and scan for shell script fragments or binaries that parse HTTP parameters and invoke shell commands without sanitization.
- Runtime monitoring (where feasible): Watch for unusual command executions initiated by the web server process and anomalous outbound connections that may indicate a compromised router.
- Policy enforcement: Incorporate secure coding guidelines for embedded web interfaces and enforce pre-release security checks, optionally using automated SAST/firmware analysis tools specialized for IoT and router platforms.

