CVE-2026-33641: Glances Glances Vulnerable To Command Injection Vulnerability

HIGH
Advisory Identifier: GHSA-qhj7-v7h7-q4c7
CVSS 7.8
CWE-78
Published
Advisory Summary

CVE-2026-33641 is a HIGH (CVSS 7.8) glances vulnerable to command injection vulnerability (CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')) affecting Glances libraries in the PyPI ecosystem. The issue involves glances vulnerable to command injection via dynamic configuration values. Remediation is available by upgrading affected packages to version 4.5.3.

CVE-2026-33641 at a Glance

CVE Identifier CVE-2026-33641
GHSA Identifier GHSA-qhj7-v7h7-q4c7
Severity HIGH
CVSS v3.1 Base Score 7.8
CWE Classification CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
Affected Product Glances
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 7.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2026-33641

To remediate this vulnerability, upgrade all affected Glances dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

Glances fixed: 4.5.3
pip install Glances>=4.5.3
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show Glances

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2026-33641, inspect your installed packages using pip:

pip show Glances

Analyze the terminal output to locate any version of Glances in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.5.3), your application is affected.

Note: The pip show Glances command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where the product constructs all or part of an os command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended os command when it is sent to a downstream component. In Glances, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## 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])) ``` 3. 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') ``` 4. 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

CVE-2026-33641 Affected Glances Versions

1 component(s)
Fixed Versions:
4.5.3
Product / Package Ecosystem Affected Versions Fixed Version
Glances
PyPI
< 4.5.3
4.5.3

References

Frequently Asked Questions

What is CVE-2026-33641?
CVE-2026-33641 is a security vulnerability in Glances involving Glances Vulnerable to Command Injection via Dynamic Configuration Values under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
Which Glances versions are affected?
Affected versions include releases prior to 4.5.3 across affected packages: Glances.
What version fixes CVE-2026-33641?
Upgrading to 4.5.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is Glances affected?
Yes, Glances is affected in releases prior to 4.5.3. Upgrade your dependency to 4.5.3 or later.
What is the CVSS score of CVE-2026-33641?
CVE-2026-33641 has a CVSS v3.1 base score of 7.8 (HIGH) with vector string CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2026-33641?
CVE-2026-33641 is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') (The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.).
How can I check PyPI dependencies for CVE-2026-33641?
Run the dependency tree command: 'pip show Glances'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-qhj7-v7h7-q4c7",
  "modified" : "2026-04-27T15:23:08Z",
  "published" : "2026-03-30T17:01:27Z",
  "aliases" : [ "CVE-2026-33641" ],
  "summary" : "Glances Vulnerable to Command Injection via Dynamic Configuration Values",
  "details" : "## Summary\nGlances 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.\n\nIf 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.\n\n## Details\n\n1. Glances loads configuration files from user, system, or custom paths during initialization.\n2. When retrieving a configuration value, Config.get_value() scans for substrings enclosed in backticks.\n\n   **File: glances/config.py**\n  \n```\nmatch = self.re_pattern.findall(ret)\nfor m in match:\n    ret = ret.replace(m, system_exec(m[1:-1]))\n```\n\n\n3. The extracted string is passed directly to system_exec().\n\n   **File: glances/globals.py**\n   \n   \n```sh\nres = subprocess.run(command.split(' '), stdout=subprocess.PIPE).stdout.decode('utf-8')\n```\n\n4. The command is executed and its output replaces the original configuration value.\n\nThis execution occurs automatically whenever the configuration value is read.\n\n### Affected Files\n\n   glances/config.py — dynamic configuration parsing\n\n   glances/globals.py — command execution helper\n\n## Proof of Concept (PoC)\n\nScenario: Arbitrary command execution via configuration value\n\n**Step 1 — Create malicious configuration file**\n\n```sh\n/tmp/glances.conf\n```\n\nadd below txt on the file\n\n```\n[outputs]\nurl_prefix = 'id'\n```\n\n**Step 2 — Launch Glances with custom configuration**\n\n```sh\nglances -C /tmp/glances.conf\n```\n\n**Step 3 — Observe behavior**\n\nWhen Glances reads the configuration:\n\n  - The command inside backticks is executed\n  - Output replaces the configuration value\n  - Execution occurs without user interaction\n  \n  \n  Reproduce using  Python code\n  \n  \n```\nimport subprocess\nimport re\n\ndef system_exec(command):\n    return subprocess.run(command.split(' '), stdout=subprocess.PIPE).stdout.decode().strip()\n\nvalue = \"`id`\"\npattern = re.compile(r'(`.+?`)')\n\nfor m in pattern.findall(value):\n    print(system_exec(m[1:-1]))\n```\n\n**Output:**\n\n\n`uid=1000(user) gid=1000(user) groups=1000(user)`\n\n## Impact\n\n### Arbitrary Command Execution\n\nAny command enclosed in backticks inside a configuration value will execute with the privileges of the Glances process.\n\n### Potential Privilege Escalation\n\nIf Glances runs as a privileged service (e.g., root), commands execute with those privileges.\n\nPossible scenarios include:\n\n-   Misconfigured file permissions allowing unauthorized config modification\n-   Shared systems where configuration directories are writable by multiple users\n-   Container environments with mounted configuration volumes\n-   Automated configuration management systems that ingest untrusted data",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "Glances"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.5.3"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 4.5.2"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/nicolargo/glances/security/advisories/GHSA-qhj7-v7h7-q4c7"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-33641"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nicolargo/glances/commit/358d76a225fc21a9f95d2c4d7e46fafe64a644c6"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/nicolargo/glances"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nicolargo/glances/releases/tag/v4.5.3"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-78" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-03-30T17:01:27Z",
    "nvd_published_at" : "2026-04-02T15:16:40Z"
  }
}