Python
CVE-2026-33641
HIGH
Severity by source
AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Primary rating from GitHub Advisory.
CVSS VectorGitHub Advisory
Lifecycle Timeline
2DescriptionGitHub Advisory
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
AnalysisAI
Command injection in Glances Python monitoring tool allows local authenticated users to execute arbitrary system commands via malicious configuration files. Attackers with write access to Glances configuration files can embed shell commands in backtick-enclosed strings that execute automatically during config parsing with the privileges of the Glances process. In environments where Glances runs as a system service with elevated privileges, this enables privilege escalation from low-privileged user to root. CVSS 7.8 (High) with local attack vector requiring low privileges. Public exploit code exists in the advisory. EPSS data not available, not listed in CISA KEV.
Technical ContextAI
Glances is a cross-platform system monitoring tool written in Python (pkg:pip/glances). The vulnerability stems from CWE-78 (OS Command Injection) in the configuration parsing logic. The Config.get_value() method in glances/config.py uses regex pattern matching to identify backtick-enclosed substrings in configuration values, then passes extracted commands directly to system_exec() in glances/globals.py without sanitization. The system_exec() function executes commands via subprocess.run() with shell word splitting, replacing the configuration value with command output. This dynamic substitution feature operates on any configuration file loaded from user directories, system paths, or custom locations specified via the -C flag. The lack of input validation, command whitelisting, or privilege checks creates an injection point exploitable by anyone with filesystem write access to configuration directories.
RemediationAI
Apply vendor-released security patches from the official Glances GitHub repository at https://github.com/nicolargo/glances/security/advisories/GHSA-qhj7-v7h7-q4c7. Specific patched version numbers are not provided in available data; consult the advisory for exact fix versions and upgrade via pip using 'pip install --upgrade glances'. As interim mitigation, restrict write access to Glances configuration files using filesystem permissions (chmod 600 for user configs, restrictive ACLs for system paths), ensuring only trusted administrators can modify glances.conf files. Remove or disable the dynamic command substitution feature if not required by commenting out backtick processing logic in config.py. Avoid running Glances with elevated privileges unless necessary; use capability-based permissions (setcap) instead of running as root. In containerized environments, mount configuration directories as read-only volumes. Audit existing configuration files for suspicious backtick-enclosed commands using 'grep -r \` /etc/glances/ ~/.config/glances/' before applying patches.
Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t
BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser
pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi
The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python
BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica
OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph
pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.
Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301
In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse
Unauthenticated remote code execution affects Kestra OSS (the open-source event-driven orchestration platform) prior to
Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/
pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne
Same weakness CWE-78 – OS Command Injection
View allSame technique Privilege Escalation
View allVendor StatusVendor
SUSE
Severity: High| Product | Status |
|---|---|
| openSUSE Tumbleweed | Fixed |
Share
External POC / Exploit Code
Leaving vuln.today
GHSA-qhj7-v7h7-q4c7