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.
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 in open(stdout_redirect, "w") (line 71) with no path validation.| for command piping (line 51): cmd.split('|') — each segment is...4.5.5Exploitability
AV:LAC:LPR:LUI:NScope
S:UImpact
C:HI:HA:H7.8/CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H