/

CVE-2026-72573

Severity:

HIGH RISK

(8.8)

OS Command Injection (CWE-78) in pm2panel Handler

CVE-2026-72573

Deferred

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78

Impact:

Arbitrary 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

CVE-2026-72573 is a high-severity OS command injection vulnerability in pm2panel, where an authenticated remote user can influence a command executed by the server.

Because the request parameter is passed to a shell without validation or escaping, an attacker may execute arbitrary system commands on the host.

Affected context

The vulnerability occurs in the pm2panel request-handling path that processes the query-string id parameter for PM2 restart operations. It affects deployments where an authenticated remote user can reach this handler and the application constructs a shell command from that parameter without enforcing a strict value format or using shell-safe process execution.

Exploit preconditions

  • Attack surface: The remotely accessible pm2panel HTTP handler that accepts the id query parameter
  • Required access: Valid authentication or another ability to reach the authenticated handler
  • Trigger point: Processing a PM2 restart request
  • Why exploitation is possible: User-controlled input is concatenated into a shell command and executed without adequate validation or shell escaping

Why this happens

The underlying flaw is direct interpolation of untrusted request data into a command executed through a system shell. Shell metacharacters and command separators can alter the intended command structure when input is not constrained to an approved format.

This behavior maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command, commonly called OS command injection. The insecure pattern is treating externally supplied data as part of executable command syntax rather than as a strictly validated argument.

Potential impact

  • An attacker may execute arbitrary operating-system commands with the application's privileges
  • The host may be compromised or used for persistence
  • Application data, credentials, and configuration files could be exposed
  • The service may be disrupted or PM2-managed processes altered
  • The compromised host could be used for lateral movement

General mitigation guidance

Mitigation generally focuses on removing shell interpretation from process-control operations and reducing trust in request parameters.

Common defensive patterns include:

  • Use direct process-execution APIs that pass arguments separately instead of invoking a shell
  • Restrict identifiers to an allowlisted format and validate them against authorized PM2 processes
  • Reject unexpected characters, encodings, types, and length values before command construction
  • Apply authorization checks so users can restart only permitted processes
  • Run the service with the minimum operating-system privileges and filesystem access required
  • Avoid exposing administrative process-control endpoints beyond necessary trust boundaries

How teams detect issues like this

Organizations can look for this vulnerability through:

  • Static analysis rules identifying string concatenation or interpolation passed to shell execution APIs
  • Code review checks for request parameters used in process, command, or shell execution
  • Runtime monitoring of unusual child processes launched by the pm2panel service
  • Web application logs showing abnormal process-control requests or unexpected parameter formats
  • Policy enforcement that requires argument-separated process APIs and approved input-validation patterns

Automated security review tools may help identify command execution calls that consume HTTP request data.

Sources

SourceLink
github.comgithub.com/4xmen/pm2panel
github.comgithub.com/4xmen/pm2panel/blob/main/pm2panel.js

Frequently asked

questions

Yes, within the application's access boundary. An attacker generally needs authenticated access to the affected remote handler and a deployment that exposes the vulnerable process-control functionality.

Authentication is required according to the vulnerability description, but the necessary account privileges may depend on pm2panel's authorization configuration. Access to the handler and permission to invoke its operation are the key conditions.

The safest pattern is to avoid shell interpretation entirely, pass process arguments through a direct execution API, and validate the requested process identifier against an explicit allowlist.

Treat all request parameters as untrusted, prohibit string-built shell commands in code review and CI policies, apply least privilege to the service account, and monitor unexpected child-process activity.

Find out what's already
exploitable in your codebase.