CVE-2026-68518: Glances has a command injection bypass of action-template sanitizer via cross-field shell-operator reconstruction
The Glances action system lets an administrator configure shell commands that run
when a monitoring threshold is crossed. The command is a Mustache template whose
variables are filled with runtime stat fields such as a process name, a container
name or a filesystem mount point. Those fields are attacker-influenceable: a
local, unprivileged user who starts a process (or a container) controls its name
and command line. The rendered command is executed by secure_popen(), which
interprets &&, | and > as chaining / pipe / redirection operators.
glances/actions.py defends against this with _sanitize_mustache_dict(), which
strips those operators from each individual template value before rendering.
The sanitization is applied per field, but the operators are reconstructed
across the boundary of two adjacent template variables after Mustache
rendering. When an action template concatenates two unescaped variables
({{{a}}}{{{b}}} or {{&a}}{{&b}}) and the attacker makes the first value end
with & and the second begin with &, the rendered command contains a real
&&, and secure_popen() executes the injected command. The single-& in each
value passes the per-field filter untouched.
References
Code Behaviors & Features
Detect and mitigate CVE-2026-68518 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →