/

CVE-2026-82412

Severity:

HIGH RISK

(8.8)

OS Command Injection (CWE-78) in ntopng Scan Endpoints

CVE-2026-82412

Deferred

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78

Impact:

Operating-System Command Execution

Severity:

HIGH RISK

(8.8)

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 ntopng's vulnerability-scan endpoints allows shell metacharacters in the scan_ports parameter to reach an nmap command without sufficient administrative authorization. An authenticated non-admin user, or a logged-in user whose browser is induced to issue a request, may cause operating-system commands to run under the ntopng process account when nmap is available.

Affected context

The issue occurs in ntopng deployments that expose the affected vulnerability-scan endpoints and permit non-admin users to reach them. The scan_ports value is insufficiently restricted before being incorporated into an nmap command, and the endpoints accept GET requests, creating an additional browser-based request-triggering concern where session and CSRF controls do not adequately cover the request format.

Exploit preconditions

  • Attack surface: ntopng web vulnerability-scan endpoints
  • Required access: An authenticated non-admin account, or a logged-in user's browser that can be induced to send a request
  • Trigger point: Processing the scan_ports parameter during host vulnerability-scan scheduling or execution
  • Runtime condition: The nmap utility must be available to the ntopng process
  • Why exploitation is possible: Input containing shell metacharacters reaches command construction and execution without an effective administrator gate or safe argument-handling boundary

Why this happens

The vulnerability results from treating user-controlled scan configuration as shell command text. The application validates scan_ports only as a single word, but that validation does not establish that the value is safe for shell interpretation. The value is then concatenated into an nmap command and passed to command-execution paths, including asynchronous execution and popen. This behavior maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command, because attacker-controlled data can alter the command interpreted by the operating system.

Potential impact

  • Arbitrary operating-system commands may execute as the ntopng process account
  • The ntopng host or container could be compromised
  • Monitoring data, credentials, or configuration files could be exposed or altered
  • The account's permissions could enable further lateral movement
  • A compromised instance could be used to disrupt monitoring or launch attacks against connected systems

General mitigation guidance

Mitigation generally focuses on eliminating shell interpretation and reducing who can invoke vulnerability-scanning functionality.

Common defensive patterns include:

  • Passing nmap arguments through an argument-vector API rather than constructing a shell command
  • Applying strict allowlist validation for ports and other scan options
  • Separating command arguments from executable selection and rejecting unexpected syntax
  • Enforcing server-side authorization so scan operations are limited to appropriate administrative roles
  • Applying CSRF protections consistently to every state-changing or command-triggering request method
  • Running ntopng with the least privileges and limiting access to sensitive host resources
  • Restricting availability and permissions of external scanning utilities where they are not required

How teams detect issues like this

Detection can combine source review, runtime monitoring, and authorization testing:

  • Search for string concatenation or interpolation of request parameters into shell commands
  • Flag uses of shell-based execution APIs such as popen and command wrappers that receive user-controlled data
  • Review validators that check superficial character classes without enforcing a complete allowlist
  • Test whether non-administrative roles can invoke scan or execution-related endpoints
  • Inspect web logs for unusual scan_ports values, unexpected request methods, and repeated scan requests
  • Monitor process execution from ntopng for anomalous child processes or commands
  • Enforce static-analysis and secure-coding policies that require argument-vector execution for external tools

Sources

SourceLink
github.comgithub.com/ntop/ntopng/commit/0d3156274f4d12db8b61432ebeded10966c01f3e
github.comgithub.com/ntop/ntopng/commit/771b34a9d37f5de989eec4f2f8f2e852db1c7e5e
github.comgithub.com/ntop/ntopng/commit/838ccd523a3d4a71b29a62f7653e572a1ffa5cf6
github.comgithub.com/ntop/ntopng/commit/9f42a12251d881e3a20ebd667c1a2e6a6570c270
github.comgithub.com/ntop/ntopng/security/advisories/GHSA-2c6p-4pfj-qv58

Frequently asked

questions

An authenticated non-admin user may be able to invoke the affected functionality when nmap is available. A browser-based trigger may also be possible against a logged-in user if request protections do not cover the accepted GET endpoints.

Direct exploitation generally requires an authenticated session. However, the browser-triggering scenario can use an existing logged-in user's session rather than the attacker's own ntopng credentials.

Avoid passing user-controlled data through a shell. Use structured process APIs with separate arguments, strict allowlists, and server-side authorization for scanning operations.

Combine command-execution restrictions, least-privilege service accounts, complete CSRF coverage, role-based endpoint testing, and static analysis for unsafe shell construction.

Find out what's already
exploitable in your codebase.