/

CVE-2026-36540

Severity:

HIGH RISK

(7.3)

OS Command Injection in Netis AC1200 Router NC21

CVE-2026-36540

Deferred

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-77

Impact:

Remote Code Execution on Router Operating System

Severity:

HIGH RISK

(7.3)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

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 password and/or new_pwd_confirm parameters 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 password and new_pwd_confirm are 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.

Sources

SourceLink
github.comgithub.com/sir3ns/cve-disclosure/blob/main/CVE-2026-36540/readme.md

Frequently asked

questions

In many scenarios, it is directly exploitable only from the local network, because the vulnerable endpoint is typically exposed on the LAN-facing management interface. However, if remote management is enabled and exposed to the internet without additional protections, remote exploitation from outside the LAN becomes feasible.

An attacker must be able to send HTTP POST requests to the router's /cgi-bin/skk_set.cgi endpoint. No authentication is required; simple network reachability to the management interface (commonly from the LAN) is sufficient.

The safest pattern is to remove direct shell command construction from web handlers and instead call internal APIs or libraries that perform the intended operation without invoking a shell. Where system calls are unavoidable, they should be parameterized, avoid shell parsing entirely, and accept only validated, strictly constrained inputs.

Prevention hinges on treating all web-supplied data as untrusted: enforce strict input validation, avoid passing raw input to shells, adopt coding standards that forbid string-built command lines, and integrate security reviews and static analysis into the firmware development lifecycle. Limiting the exposure of management interfaces and applying least-privilege design further reduces the blast radius of any remaining issues.

Find out what's already
exploitable in your codebase.