Loading advisory.
Loading advisory.
Glances Vulnerable to Command Injection via Dynamic Configuration Values
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.
Published 2026-03-30 17:01 UTC · Modified 2026-07-13 07:26 UTC
Severity and EPSS are shown separately. Helm does not combine them into one score. How tiers work
| Package | Ecosystem | Affected | Fixed in | Upgrade command |
|---|---|---|---|---|
| glances | PyPI | < 4.5.3 versions 1.3.1, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.3.6, 1.3.7, 1.4, 1.4.1, 1.4.1.1, 1.4.2, 1.4.2.1, 1.5, 1.5.1, 1.5.2, 1.6, 1.6.1, 1.7, 1.7.1, 1.7.2 and 112 more | 4.5.3 | pip install --upgrade 'glances>=4.5.3' |
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.
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.
glances/config.py — dynamic configuration parsing
glances/globals.py — command execution helper
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)
Any command enclosed in backticks inside a configuration value will execute with the privileges of the Glances process.
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
Exploit code or a detection template for this CVE is published by the sources below. This is not a report of use against real systems (that is what CISA KEV records) and it does not change the tier.
EPSS went from 0.009 on 2026-11-24 to 0.009 on 2026-11-30, over 3 recorded scores.
| Date | Score | Previous | Model |
|---|---|---|---|
| 2026-11-24 | 0.009 | first score | v2026.06.15 |
| 2026-11-26 | 0.008 | 0.009 | v2026.06.15 |
| 2026-11-30 | 0.009 | 0.008 | v2026.06.15 |