Glances has arbitrary file write and command execution via `secure_popen` redirection and chaining operators in AMP command configuration
Date: 2026-06
Affected: pip/glances
Attack vector: path-traversal
Category: vulnerability-disclosure
Severity: High
CVE: CVE-2026-46607
CVE-2026-46608
CVE-2026-46611
CVE-2026-53925
CWE: CWE-183
CWE-22
CWE-346
CWE-350
CWE-502
CWE-942
CVSS: 7.8 (CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H)

### 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`)** ```


Mitigations:

Architectural layers (MAESTRO):