HIGH 7.8

CVE-2026-46606: Glances KVM/QEMU Command Injection – Local Privilege Escalation

Glances, a popular open-source system monitoring tool, contains a critical flaw in how it handles virtual machine names when monitoring KVM/QEMU environments. An attacker with local access to create or rename virtual machines can inject shell commands into those names, causing Glances to execute arbitrary commands with the privileges of the user running it—typically root on hypervisor hosts. This issue affects all versions prior to 4.5.5.

Source data · NVD / CISA · public domain

CVSS
3.1 · 7.8 HIGH · CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Weaknesses (CWE)
CWE-78
Affected products
0 configuration(s)
Published / Modified
2026-06-25 / 2026-06-25

NVD description (verbatim)

Glances is an open-source system cross-platform monitoring tool. Prior to 4.5.5, 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. This vulnerability is fixed in 4.5.5.

3 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

The vulnerability resides in glances/plugins/vms/engines/virsh.py, where VM domain names retrieved from virsh list --all output are directly interpolated into f-string command templates without sanitization. These templates are then passed to secure_popen(), a function that explicitly interprets shell metacharacters (&&, |, >) as operators rather than literal strings. An attacker can craft a VM domain name containing shell metacharacters to break out of the intended command context and execute arbitrary shell commands. The flaw is a classic case of insufficient input validation (CWE-78: Improper Neutralization of Special Elements used in an OS Command) preceding a function designed to process shell syntax.

Business impact

Organizations using Glances for KVM/QEMU hypervisor monitoring face privilege escalation risk. On systems where Glances runs as root—a common configuration for comprehensive system monitoring—successful exploitation grants an attacker root-level code execution. This is particularly severe in virtualized environments where hypervisors are central to infrastructure security. Even on non-root deployments, the attacker gains code execution as the Glances process user, potentially leading to lateral movement, data exfiltration, or further system compromise. The attack surface includes any user able to create or rename VMs, such as cloud administrators, DevOps engineers, or compromised service accounts with VM management permissions.

Affected systems

Glances versions prior to 4.5.5 are vulnerable. The vulnerability is specific to the KVM/QEMU monitoring engine and only manifests when that engine is active—users monitoring other virtualization platforms or running Glances without VM monitoring functionality are unaffected. Risk is highest on hypervisor hosts where Glances runs with elevated privileges and where multiple users or automated systems have VM creation/rename permissions.

Exploitability

Exploitability is straightforward for an attacker with local VM management access. No network access, authentication bypass, or social engineering is required beyond the ability to create or rename a virtual machine—a legitimate administrative capability in many environments. The attack requires no user interaction and leaves minimal forensic traces if execution logs are not carefully monitored. The CVSS vector (AV:L/AC:L/PR:L/UI:N/S:U) reflects local access and low attack complexity; the high impact scores (C:H/I:H/A:H) reflect confidentiality, integrity, and availability compromise at the OS level.

Remediation

Upgrade Glances to version 4.5.5 or later, which sanitizes VM domain names before passing them to shell command templates. Organizations unable to upgrade immediately should restrict VM creation and rename permissions to trusted administrators only, monitor virsh and Glances logs for suspicious domain names, and consider isolating Glances monitoring on separate administrative networks. Running Glances with the minimum necessary privilege (non-root where feasible) reduces the impact of exploitation.

Patch guidance

Update Glances to version 4.5.5 or newer. Verify the patch is applied by checking the installed version (glances --version). For containerized deployments, pull the latest Glances image and redeploy; for package managers, use apt update && apt upgrade glances or equivalent. Test in a non-production environment first to ensure compatibility with your monitoring setup. The fix involves input validation—no configuration changes are required post-upgrade.

Detection guidance

Monitor for VM domain names containing shell metacharacters (&&, |, >, ;, $(), backticks, etc.) in virsh output or hypervisor logs. Audit VM creation and rename operations for anomalous domain names. Review Glances process logs and syslog for unexpected command execution or errors originating from the virsh monitoring engine. If Glances runs under a service account, monitor that account's process execution for unexpected child processes or commands. Intrusion detection systems can flag process execution from Glances with suspicious command-line arguments.

Why prioritize this

This vulnerability merits immediate attention due to the combination of local privilege escalation (to root in typical deployments), ease of exploitation by administrators or DevOps personnel, and high likelihood of presence in virtualized infrastructure environments. The attack requires minimal effort from a threat actor already inside the administrative boundary, making it a strong target for insider threats or post-compromise lateral movement. Organizations managing multiple hypervisor hosts should treat this as a coordinated patching priority.

Risk score, explained

The CVSS 3.1 score of 7.8 (HIGH) reflects a local attack vector with low complexity, requiring low privileges and no user interaction, combined with high impact across confidentiality, integrity, and availability. The score appropriately penalizes the attack's potential for root-level code execution on critical infrastructure (hypervisors). However, risk elevation applies in environments where Glances is widely deployed, runs with elevated privileges, or monitors systems with sensitive workloads.

Frequently asked questions

Does this affect Glances installations that do not monitor virtual machines?

No. The vulnerability is specific to the KVM/QEMU monitoring engine within Glances. If your Glances installation does not use the virsh integration or does not monitor virtual machines, this CVE does not apply. You can verify by checking your Glances configuration for VM monitoring plugins and whether virsh commands are being executed.

What is the practical impact if Glances runs as a non-root user?

If Glances runs as a non-root service account (e.g., glances:glances), the attacker gains code execution as that user rather than root. This is still a serious compromise because it may allow lateral movement, access to sensitive monitoring data, or privilege escalation through secondary vulnerabilities. Running with minimal privilege is a mitigation but not a complete remediation—upgrading is necessary.

Can this be exploited remotely?

No. The attack requires local access to create or rename virtual machines, which typically requires administrative or operator privileges on the hypervisor. Remote exploitation is not possible unless an attacker first gains local or administrative access through another vulnerability.

How can I detect if this vulnerability has been exploited in my environment?

Review audit logs for VM creation or rename operations with suspicious names containing shell metacharacters. Check Glances process logs and syslog for unexpected command execution errors from the virsh monitoring component. Monitor the process execution activity of the Glances service account for unexpected child processes or commands. If Glances has detailed logging enabled, look for malformed or unusual domain names in the VM enumeration logs.

This analysis is based on the published CVE description and available technical data as of the publication date. Security professionals should verify patch availability, compatibility, and applicability to their specific deployment before taking remediation action. Consult the official Glances project documentation and security advisories for the most current guidance. This explainer does not constitute professional security advice; organizations should engage qualified security personnel for risk assessment and incident response. Source: NVD (public-domain), retrieved 2026-08-03. Analysis generated by SEC.co (claude-haiku-4-5).