/

CVE-2026-46607

Severity:

HIGH RISK

(7.8)

Unsafe Pickle Deserialization (CWE-502) in Glances Cache

CVE-2026-46607

Deferred

Vulnerability type

Category:

Unsafe Deserialization

CWE:

CWE-502

Impact:

Local Arbitrary Code Execution

Severity:

HIGH RISK

(7.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Glances performs unsafe pickle deserialization on a version-check cache file stored at a predictable, world-accessible path, without integrity or format validation.

An attacker with write access to this cache location can plant a malicious pickle and gain arbitrary code execution as the OS user running Glances when version checking is triggered.

Affected context

This vulnerability appears in environments where Glances runs with version checking enabled (the default) and relies on a cache file located under the user's XDG cache directory or ~/.cache/glances/.

It is most relevant on multi-user systems, shared workstations, and containerized setups where other processes or users may influence files in the Glances cache directory.

The issue manifests when Glances trusts the contents of the cache file and deserializes it with pickle.load() without verifying authenticity or enforcing a restricted data format.

Exploit preconditions

  • Attack surface: Local, via the filesystem path to the Glances cache (~/.cache/glances/glances-version.db or $XDG_CACHE_HOME/glances/glances-version.db).
  • Required access: Ability to write or replace the Glances version cache file as the same user or via broader filesystem permissions (e.g., shared home directory, misconfigured mounts, or compromised container).
  • Trigger point: Glances startup (or subsequent runs) with version checking enabled, when it calls pickle.load() on the cache file.
  • Why exploitation is possible: Python pickle deserialization executes attacker-controlled opcodes embedded in the pickle stream, and Glances does not perform signature checks, integrity validation, or enforce a safe serialization format before calling pickle.load().

Why this happens

The root cause is reliance on Python's pickle module for persisting and restoring application state without treating the serialized data as untrusted input.

Pickle is a general-purpose object serialization mechanism that can invoke arbitrary constructors and code paths during deserialization; when used on data from a world-accessible or otherwise writeable location, it becomes an unsafe deserialization primitive.

In Glances, the version-check cache file is stored at a predictable filesystem path and read back with pickle.load() without any authenticity or integrity guarantees, mapping directly to CWE-502: Deserialization of Untrusted Data.

Potential impact

  • An attacker could execute arbitrary Python or OS-level commands in the context of the user running Glances.
  • Malicious code can be used to install local malware or backdoors on the affected system.
  • Attackers may access or modify user data available to the Glances process.
  • Local privilege escalation may be possible if combined with other vulnerabilities or misconfigurations.
  • Compromise of monitoring workflows and integrity of system metrics collection.

General mitigation guidance

Effective mitigation centers on eliminating unsafe deserialization patterns and tightening trust boundaries around cached state.

Recommended design patterns include:

  • Avoiding pickle for persistent storage of data that may be influenced by untrusted actors, favoring simple, structured formats such as JSON or plain text.
  • Adding integrity checks or cryptographic signatures when cached data must be trusted, ensuring only data produced by the application is accepted.
  • Storing sensitive cache files in directories with restricted permissions and avoiding world-accessible or shared locations for executable state.
  • Implementing defensive defaults: disable non-essential features that rely on executable serialization formats unless explicitly needed and validated.
  • Applying least-privilege principles so that Glances runs with minimal filesystem access, limiting the damage if deserialization issues occur.

How teams detect issues like this

Detection often involves a combination of static inspection, configuration review, and behavioral monitoring:

  • Use static analysis or linters to flag calls to pickle.load() and similar deserialization APIs where input originates from disk, network, or other untrusted sources.
  • During code review, treat serialization and cache-handling logic as sensitive, looking for predictable paths, world-accessible directories, and lack of integrity checks.
  • Incorporate security-focused test cases that attempt to deserialize crafted, non-conforming data and validate that the application rejects or safely handles it.
  • Apply organizational policies that discourage or restrict the use of executable serialization formats (like pickle) in production codebases, backed by automated scanning tools in CI pipelines.

Sources

SourceLink
github.comgithub.com/nicolargo/glances/releases/tag/v4.5.5
github.comgithub.com/nicolargo/glances/security/advisories/GHSA-9837-48hr-q32j

Frequently asked

questions

Not directly. Exploitation typically requires local or container-level access to the filesystem path where Glances stores its version cache file, though such access can arise from shared environments or other compromises.

The attacker needs the ability to create or overwrite the Glances version cache file under the affected user's cache directory. This might be possible for another user on a shared system, a process in the same container, or malware running under that account.

The safest pattern is to stop using pickle for data that can be influenced by untrusted parties and instead adopt non-executable serialization formats (like JSON) combined with strict schema validation and appropriate file permissions.

Establish engineering guidelines that treat deserialization as a high-risk operation, forbid unsafe formats such as pickle for cross-trust-boundary data, enforce code review checks around serialization logic, and rely on automated scanning to detect insecure deserialization APIs early in the development lifecycle.

Find out what's already
exploitable in your codebase.