Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
🐍 PyPI

GHSA-qhj7-v7h7-q4c7

HIGH

GHSA-qhj7-v7h7-q4c7 is a high-severity (CVSS 7.8) OS Command Injection vulnerability in glances. 1 public exploit reference exists, so weaponization risk is real. O3 Security confirms whether GHSA-qhj7-v7h7-q4c7 is actually reachable in your code before you act, and blocks exploitation at runtime until you patch.

Glances Vulnerable to Command Injection via Dynamic Configuration Values

Also known asCVE-2026-33641PYSEC-2026-2174
Published
Mar 30, 2026
Updated
Jul 13, 2026
Affected
1 pkg
Patched
1 / 1
Exploits
1 known

Blast Radius

1 pkg affected
🐍glances

Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.

Description

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

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

/tmp/glances.conf

add below txt on the file

[outputs]
url_prefix = 'id'

Step 2 — Launch Glances with custom configuration

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

Affected Packages

1 total 1 fixed
EcosystemPackageVulnerable rangeFix
🐍PyPIglancesall versions4.5.3
Exploits & PoCs
1

Research use only. For defensive security, authorized penetration testing, and academic research only. Never execute exploit code against systems without explicit written authorization.

EDB-52559webappsmultiple

glances 4.5.2 - command injection

by best.sell · May 13, 2026

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for glances. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.

  2. Fix

    Update glances to 4.5.3 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-qhj7-v7h7-q4c7 is resolved across your whole dependency graph.

  3. Workarounds

    If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.

  4. How O3 protects you

    O3 pinpoints whether GHSA-qhj7-v7h7-q4c7 is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.

Tailored to GHSA-qhj7-v7h7-q4c7. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.

Frequently Asked Questions

## 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.
O3 Security · Impact-Aware SCA

Is GHSA-qhj7-v7h7-q4c7 in your dependencies?

O3 detects GHSA-qhj7-v7h7-q4c7 across PyPI dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.