CVE-2026-46606 is a high-severity OS command injection vulnerability in glances (pip), affecting versions < 4.5.5. It is fixed in 4.5.5.
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 securepopen(). securepopen() 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: 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 securepopen(). securepopen() 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: By contrast, actions.py sanitises process names through sanitizemustachedict() before they reach securepopen(). The vms plugin applies no such protection. Confirmed on: x8664 Linux, Python 3.13, Glances 4.5.5dev1 (commit 04579778e733d705898a169e049dc84772c852da). All three injection operators were verified: | Operator | Effect | Confirmed | |----------|--------|-----------| | && | Second command executes after the virsh call | Yes | | \| | Output of virsh piped to injected command | Yes | | > | virsh output redirected to arbitrary file | Yes | 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: Step 2, Start Glances with KVM monitoring enabled On the next monitoring cycle Glances calls: which securepopen() splits into two processes: virsh domstats --nowait productionDB touch /tmp/glancespwned Step 3, Verify execution Pipe injection (|) example Domain name: "productionDB | tee /tmp/virshoutputstolen.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/glancesbackdoor" The virsh output is redirected to a cron file, enabling persistent code execution on the next cron cycle. Minimal Python reproduction (no VM required) 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, authorisedkeys, 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 securepopen()'s operator splitting logic: Alternatively, sanitise domain using the same sanitizemustachedict 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 CAPSYSPTRACE 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.
Untrusted input reaches a shell command, allowing arbitrary commands to run on the host. Typical impact: code execution in the application's environment.
CVE-2026-46606 has a CVSS score of 7.8 (High). The vector is requires local access, low privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment.
A fixed version is available (4.5.5). Upgrading removes the vulnerable code path.
pip
glances (< 4.5.5)glances → 4.5.5 (pip)Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter instead of chasing every advisory.
Kodem's Application Detection and Response identifies whether CVE-2026-46606 is reachable in your applications. Explore runtime application protection for your team.
See if CVE-2026-46606 is reachable in your applications. Get a demo
Already deployed Kodem? See CVE-2026-46606 in your environment →Upgrade glances to 4.5.5 or later to resolve this vulnerability.
Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.
CVE-2026-46606 is a high-severity OS command injection vulnerability in glances (pip), affecting versions < 4.5.5. It is fixed in 4.5.5. Untrusted input reaches a shell command, allowing arbitrary commands to run on the host.
CVE-2026-46606 has a CVSS score of 7.8 (High). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
glances (pip) versions < 4.5.5 is affected.
Yes. CVE-2026-46606 is fixed in 4.5.5. Upgrade to this version or later.
Whether CVE-2026-46606 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
Upgrade glances to 4.5.5 or later.