CVE-2026-33641: Glances Glances Vulnerable To Command Injection Vulnerability
HIGHCVE-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
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).
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.
pip install Glances>=4.5.3
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
CVE-2026-33641 Affected Glances Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
Glances
|
PyPI |
< 4.5.3
|
4.5.3
|
References
Frequently Asked Questions
What is CVE-2026-33641?
Which Glances versions are affected?
What version fixes CVE-2026-33641?
Is Glances affected?
What is the CVSS score of CVE-2026-33641?
What CWE is associated with CVE-2026-33641?
How can I check PyPI dependencies for CVE-2026-33641?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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"
}
}