/

CVE-2026-77004

Severity:

HIGH RISK

(7.4)

Command Injection (CWE-77) in Comfast CF-N1-S CGI

CVE-2026-77004

Deferred

Vulnerability type

Category:

Command Injection

CWE:

CWE-74, CWE-77

Impact:

Remote Code Execution

Severity:

HIGH RISK

(7.4)

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

A command injection vulnerability in the Comfast CF-N1-S web interface allows attacker-controlled input in the sn argument to reach a system command construction path. Because the affected endpoint is remotely accessible, an attacker who can reach it may execute commands with the privileges of the web service.

Affected context

The vulnerability occurs in Comfast CF-N1-S version 2.6.0.1 when the /cgi-bin/mbox-config endpoint processes requests using method=SET, section=ptest_sn, and the sn argument. Risk is higher when the management interface is reachable from untrusted networks and the endpoint does not sufficiently constrain or isolate the supplied value before it reaches command-related processing.

Exploit preconditions

  • Attack surface: The device's remotely reachable web management interface
  • Required access: Network reachability to the affected CGI endpoint; authentication requirements depend on device configuration
  • Trigger point: Processing of a request targeting the ptest_sn section with a supplied sn value
  • Why exploitation is possible: User-controlled input can influence command construction or execution through the affected sprintf processing path

Why this happens

The underlying bug is an OS command injection condition, mapped primarily to CWE-77 and more broadly to CWE-74. The application incorporates externally controlled data into a command-related string without maintaining a strict separation between data and command syntax. The use of formatted string construction in this context can allow input to alter the intended operation rather than remain a passive parameter.

Potential impact

  • An attacker may execute arbitrary commands on the device
  • The device could be fully compromised
  • Configuration, credentials, or operational data could be exposed
  • Network traffic could be monitored or altered
  • The device could be used for lateral movement or additional attacks

General mitigation guidance

Mitigation generally focuses on removing shell interpretation from request

handling and reducing trust in management-interface input.

Common defensive patterns include:

  • Prefer direct library or system APIs that accept structured arguments instead of constructing shell commands
  • Apply strict allowlist validation for values such as serial or test identifiers
  • Use context-appropriate escaping only as a secondary control, not as a substitute for eliminating command interpretation
  • Restrict management interfaces to trusted administrative networks
  • Run web-facing services with the minimum practical privileges
  • Isolate device management processes and limit their access to sensitive resources
  • Treat all request parameters as untrusted until validated and normalized

How teams detect issues like this

Organizations can look for command-injection risks through:

  • Static analysis rules identifying formatted strings or concatenation near process-launch APIs
  • Code review checks for request parameters flowing into shell commands
  • Tests that verify metacharacters and unexpected input are rejected without invoking system operations
  • Network monitoring for unusual requests to CGI management endpoints
  • Policy enforcement requiring structured process APIs and allowlist validation for administrative interfaces
  • Automated security review tools that trace untrusted data into command-execution sinks

Sources

SourceLink
github.comgithub.com/lxiansheng488-bit/-/blob/main/%E5%8E%82%E5%95%86comefast%20%20CF-N1-S%20V2.pdf
vuldb.comvuldb.com/cve/CVE-2026-77004
vuldb.comvuldb.com/submit/880584
vuldb.comvuldb.com/vuln/393623
vuldb.comvuldb.com/vuln/393623/cti

Frequently asked

questions

Yes. The vulnerable functionality is exposed through a CGI-based web interface,

so exploitation may be possible over the network when the endpoint is

reachable and required access controls are satisfied.

The provided information does not establish the authentication requirement.

Exposure depends on the device's management-interface configuration and any

access controls protecting the endpoint.

Avoid constructing commands from request data. Use direct APIs with structured

arguments, enforce strict allowlists, and ensure the service runs with

minimal privileges.

Treat every management-interface parameter as untrusted, review data flows

into process-launch functions, restrict administrative network exposure, and

use static analysis and security-focused testing in development workflows.

Find out what's already
exploitable in your codebase.