Skip to main content

Python CVE-2026-33641

HIGH
OS Command Injection (CWE-78)
2026-03-30 https://github.com/nicolargo/glances GHSA-qhj7-v7h7-q4c7
7.8
CVSS 3.1 · GitHub Advisory
Share

Severity by source

GitHub Advisory PRIMARY
7.8 HIGH
AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
SUSE
HIGH
qualitative

Primary rating from GitHub Advisory.

CVSS VectorGitHub Advisory

Attack Vector
Local
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

Lifecycle Timeline

2
Analysis Generated
Mar 30, 2026 - 17:15 vuln.today
CVE Published
Mar 30, 2026 - 17:01 nvd
HIGH 7.8

DescriptionGitHub Advisory

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

sh
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

sh
/tmp/glances.conf

add below txt on the file

[outputs]
url_prefix = 'id'

Step 2 - Launch Glances with custom configuration

sh
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

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

AnalysisAI

Command injection in Glances Python monitoring tool allows local authenticated users to execute arbitrary system commands via malicious configuration files. Attackers with write access to Glances configuration files can embed shell commands in backtick-enclosed strings that execute automatically during config parsing with the privileges of the Glances process. In environments where Glances runs as a system service with elevated privileges, this enables privilege escalation from low-privileged user to root. CVSS 7.8 (High) with local attack vector requiring low privileges. Public exploit code exists in the advisory. EPSS data not available, not listed in CISA KEV.

Technical ContextAI

Glances is a cross-platform system monitoring tool written in Python (pkg:pip/glances). The vulnerability stems from CWE-78 (OS Command Injection) in the configuration parsing logic. The Config.get_value() method in glances/config.py uses regex pattern matching to identify backtick-enclosed substrings in configuration values, then passes extracted commands directly to system_exec() in glances/globals.py without sanitization. The system_exec() function executes commands via subprocess.run() with shell word splitting, replacing the configuration value with command output. This dynamic substitution feature operates on any configuration file loaded from user directories, system paths, or custom locations specified via the -C flag. The lack of input validation, command whitelisting, or privilege checks creates an injection point exploitable by anyone with filesystem write access to configuration directories.

RemediationAI

Apply vendor-released security patches from the official Glances GitHub repository at https://github.com/nicolargo/glances/security/advisories/GHSA-qhj7-v7h7-q4c7. Specific patched version numbers are not provided in available data; consult the advisory for exact fix versions and upgrade via pip using 'pip install --upgrade glances'. As interim mitigation, restrict write access to Glances configuration files using filesystem permissions (chmod 600 for user configs, restrictive ACLs for system paths), ensuring only trusted administrators can modify glances.conf files. Remove or disable the dynamic command substitution feature if not required by commenting out backtick processing logic in config.py. Avoid running Glances with elevated privileges unless necessary; use capability-based permissions (setcap) instead of running as root. In containerized environments, mount configuration directories as read-only volumes. Audit existing configuration files for suspicious backtick-enclosed commands using 'grep -r \` /etc/glances/ ~/.config/glances/' before applying patches.

More in Python

View all
CVE-2025-24016 CRITICAL POC
9.9 Feb 10

Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t

CVE-2025-27520 CRITICAL POC
9.8 Apr 04

BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser

CVE-2025-2945 CRITICAL POC
9.9 Apr 03

pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi

CVE-2013-5093 MEDIUM POC
6.8 Sep 27

The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python

CVE-2025-32375 CRITICAL POC
9.8 Apr 09

BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica

CVE-2014-0224 HIGH POC
7.4 Jun 05

OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph

CVE-2024-21644 HIGH POC
7.5 Jan 08

pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.

CVE-2026-33017 CRITICAL POC
9.3 Mar 17

Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301

CVE-2017-9462 HIGH POC
8.8 Jun 06

In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse

CVE-2026-49869 CRITICAL POC
10.0 Jun 26

Unauthenticated remote code execution affects Kestra OSS (the open-source event-driven orchestration platform) prior to

CVE-2026-39987 CRITICAL POC
9.3 Apr 08

Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/

CVE-2024-21645 MEDIUM POC
5.3 Jan 08

pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne

Vendor StatusVendor

SUSE

Severity: High
Product Status
openSUSE Tumbleweed Fixed

Share

CVE-2026-33641 vulnerability details – vuln.today

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy