/

CVE-2026-62982

Severity:

HIGH RISK

(8.8)

OS Command Injection (CWE-78) in Glances Action Templates

CVE-2026-62982

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

Glances contains an OS command injection vulnerability in its administrator-configured action templates. When nested process data containing pipe characters is rendered without complete sanitization, an attacker may influence command execution if they can control or cause malicious process metadata to be processed.

Affected context

The issue occurs in Glances versions that use _sanitize_mustache_dict() before rendering action templates with Chevron and executing them through secure_popen(). It is most relevant when monitoring data includes nested lists or dictionaries, such as process command-line values, and administrators have configured actions that incorporate rendered values into shell commands.

Exploit preconditions

  • Attack surface: Glances action-template processing and command execution
  • Required access: Ability to influence monitored process metadata or another value incorporated into an action template
  • Trigger point: Rendering and execution of an administrator-configured action
  • Why exploitation is possible: Sanitization does not consistently inspect strings nested inside lists and dictionaries, allowing shell metacharacters to reach the command execution path

Why this happens

The vulnerability results from incomplete recursive input sanitization before template rendering and process execution. Nested collection values are not handled with the same protections as top-level strings, so attacker-influenced data can retain shell control characters that are later interpreted by a command execution function. This behavior maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command.

Potential impact

  • An attacker could execute commands with the privileges of the Glances process
  • The monitoring host or container could be compromised
  • Sensitive system or application data may be accessed
  • Malicious commands could alter monitored systems or disrupt services
  • Compromised hosts could potentially be used for lateral movement

General mitigation guidance

Mitigation generally focuses on preventing monitored data from becoming executable command syntax.

Defensive patterns include:

  • Avoiding shell interpretation when invoking actions, using structured argument arrays instead
  • Applying recursive validation and context-appropriate escaping to all rendered values
  • Treating process metadata and other monitoring data as untrusted input
  • Restricting action templates to approved commands and fixed argument patterns
  • Running monitoring services with the least privileges necessary
  • Separating display-oriented templating from command execution workflows

How teams detect issues like this

Detection can include:

  • Static analysis for shell execution APIs receiving template-rendered or monitoring-derived values
  • Code review checks for sanitization functions that process only top-level dictionary entries
  • Tests using nested lists and dictionaries containing shell metacharacters
  • Runtime monitoring for unexpected child processes spawned by Glances
  • Policy enforcement requiring structured process invocation and approved action commands
  • Automated security review tools that flag command construction from externally influenced data

Sources

SourceLink
github.comgithub.com/nicolargo/glances/commit/ea4cf2f54f0d961e24aa0b24fff9584bab39db93
github.comgithub.com/nicolargo/glances/releases/tag/v4.5.6
github.comgithub.com/nicolargo/glances/security/advisories/GHSA-73wf-9vmv-5pv9

Frequently asked

questions

Exploitability depends on deployment and monitoring inputs. It may be reachable remotely when an attacker can influence process metadata or another value consumed by a configured action, but local influence may also be sufficient.

Not necessarily. Administrator-configured actions provide the execution context, while the key prerequisite is the ability to control data that reaches those actions.

Keep untrusted monitoring data out of shell syntax and invoke fixed commands with structured arguments rather than interpolated shell command strings.

Use recursive input handling, test nested data structures, enforce allowlisted action definitions, and run monitoring components with minimal privileges.

Find out what's already
exploitable in your codebase.