glances
Affected
- introduced
0, fixed4.5.3(ecosystem)
Fixed versions
4.5.3
Fix
- Fixed version
4.5.3pip install --upgrade glances==4.5.3
Advisory
Also known as: CVE-2026-33641, PYSEC-2026-2174
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.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
File: glances/config.py
match = self.re_pattern.findall(ret)
for m in match:
ret = ret.replace(m, system_exec(m[1:-1]))
File: glances/globals.py
res = subprocess.run(command.split(' '), stdout=subprocess.PIPE).stdout.decode('utf-8')
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.conf
add below txt on the file
[outputs]
url_prefix = 'id'
Step 2 — Launch Glances with custom configuration
glances -C /tmp/glances.conf
Step 3 — Observe behavior
When Glances reads the configuration:
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:
High Basis: The source's own band: HIGH
0, fixed 4.5.3 (ecosystem)4.5.3
4.5.3pip install --upgrade glances==4.5.3Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0