CVE-2026-35588: Glances Glances Has CQL Injection Vulnerability

MODERATE
Advisory Identifier: GHSA-grp3-h8m8-45p7
CVSS 6.3
CWE-89
Published
Advisory Summary

CVE-2026-35588 is a MODERATE (CVSS 6.3) glances has cql injection vulnerability (CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')) affecting Glances libraries in the PyPI ecosystem. The issue involves glances has cql injection in its cassandra export module via unsanitized config values. Remediation is available by upgrading affected packages to version 4.5.4.

CVE-2026-35588 at a Glance

CVE Identifier CVE-2026-35588
GHSA Identifier GHSA-grp3-h8m8-45p7
Severity MODERATE
CVSS v3.1 Base Score 6.3
CWE Classification CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
Affected Product Glances
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 6.3

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

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

How to Fix CVE-2026-35588

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.4
pip install glances>=4.5.4
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-35588, 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.4), 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-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where the product constructs all or part of an sql command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended sql command when it is sent to a downstream component. without sufficient removal or quoting of sql syntax in user-controllable inputs, the generated sql query can cause those inputs to be interpreted as sql instead of ordinary user data. 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 The Cassandra export module (`glances/exports/glances_cassandra/__init__.py`) interpolates `keyspace`, `table`, and `replication_factor` configuration values directly into CQL statements without validation. A user with write access to `glances.conf` can redirect all monitoring data to an attacker-controlled Cassandra keyspace. ## Vulnerable Code ```python # Line 80 f"CREATE KEYSPACE {self.keyspace} WITH " f"replication = {{ 'class': 'SimpleStrategy', 'replication_factor': '{self.replication_factor}' }}" # Line 94 f"CREATE TABLE {self.table} (plugin text, time timeuuid, stat map<text,float>, PRIMARY KEY (plugin, time)) WITH CLUSTERING ORDER BY (time DESC)" # Line 112 stmt = f"INSERT INTO {self.table} (plugin, time, stat) VALUES (?, ?, ?)" ``` ## Steps to Reproduce 1. Configure `glances.conf` with malicious `table` value: ```ini [cassandra] host = 127.0.0.1 port = 9042 keyspace = glances table = attacker_ks.captured_stats ``` 2. Create attacker keyspace in Cassandra 3. Run `glances --export cassandra` 4. All monitoring data is written to `attacker_ks.captured_stats` instead of the legitimate table **Confirmed output:** ``` INSERT stmt: INSERT INTO attacker_ks.captured_stats (plugin, time, stat) VALUES (?, ?, ?) Legitimate table row count: 0 Attacker table row count: 1 [CONFIRMED] plugin=cpu, stat={'user': 50.0} ``` ## Impact All exported monitoring data (CPU, memory, network, disk I/O) is silently redirected to an attacker-controlled Cassandra keyspace — both data exfiltration and data loss. ## Proposed Fix ```python import re def _validate_cql_identifier(name: str) -> str: if not re.match(r'^[a-zA-Z_][a-zA-Z0-9_.]*$', name): raise ValueError(f"Invalid CQL identifier: {name!r}") return name # In __init__(): validate before use self.keyspace = _validate_cql_identifier(self.keyspace) self.table = _validate_cql_identifier(self.table) ``` ![PoC](https://raw.githubusercontent.com/n0z0/cve-evidence/main/2026-04/20260403_004238_glances_cassandra_cql_injection_poc.png)

CVE-2026-35588 Affected Glances Versions

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

References

Frequently Asked Questions

What is CVE-2026-35588?
CVE-2026-35588 is a security vulnerability in Glances involving Glances has CQL Injection in its Cassandra Export Module via Unsanitized Config Values under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').
Which Glances versions are affected?
Affected versions include releases prior to 4.5.4 across affected packages: glances.
What version fixes CVE-2026-35588?
Upgrading to 4.5.4 (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.4. Upgrade your dependency to 4.5.4 or later.
What is the CVSS score of CVE-2026-35588?
CVE-2026-35588 has a CVSS v3.1 base score of 6.3 (MODERATE) with vector string CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:L.
What CWE is associated with CVE-2026-35588?
CVE-2026-35588 is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') (The product constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data.).
How can I check PyPI dependencies for CVE-2026-35588?
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-grp3-h8m8-45p7",
  "modified" : "2026-04-21T15:18:58Z",
  "published" : "2026-04-21T15:18:58Z",
  "aliases" : [ "CVE-2026-35588" ],
  "summary" : "Glances has CQL Injection in its Cassandra Export Module via Unsanitized Config Values",
  "details" : "## Summary\n\nThe Cassandra export module (`glances/exports/glances_cassandra/__init__.py`) interpolates `keyspace`, `table`, and `replication_factor` configuration values directly into CQL statements without validation. A user with write access to `glances.conf` can redirect all monitoring data to an attacker-controlled Cassandra keyspace.\n\n## Vulnerable Code\n\n```python\n# Line 80\nf\"CREATE KEYSPACE {self.keyspace} WITH \"\nf\"replication = {{ 'class': 'SimpleStrategy', 'replication_factor': '{self.replication_factor}' }}\"\n\n# Line 94\nf\"CREATE TABLE {self.table} (plugin text, time timeuuid, stat map<text,float>, PRIMARY KEY (plugin, time)) WITH CLUSTERING ORDER BY (time DESC)\"\n\n# Line 112\nstmt = f\"INSERT INTO {self.table} (plugin, time, stat) VALUES (?, ?, ?)\"\n```\n\n## Steps to Reproduce\n\n1. Configure `glances.conf` with malicious `table` value:\n```ini\n[cassandra]\nhost = 127.0.0.1\nport = 9042\nkeyspace = glances\ntable = attacker_ks.captured_stats\n```\n2. Create attacker keyspace in Cassandra\n3. Run `glances --export cassandra`\n4. All monitoring data is written to `attacker_ks.captured_stats` instead of the legitimate table\n\n**Confirmed output:**\n```\nINSERT stmt: INSERT INTO attacker_ks.captured_stats (plugin, time, stat) VALUES (?, ?, ?)\nLegitimate table row count: 0\nAttacker table row count: 1\n[CONFIRMED] plugin=cpu, stat={'user': 50.0}\n```\n\n## Impact\n\nAll exported monitoring data (CPU, memory, network, disk I/O) is silently redirected to an attacker-controlled Cassandra keyspace — both data exfiltration and data loss.\n\n## Proposed Fix\n\n```python\nimport re\n\ndef _validate_cql_identifier(name: str) -> str:\n    if not re.match(r'^[a-zA-Z_][a-zA-Z0-9_.]*$', name):\n        raise ValueError(f\"Invalid CQL identifier: {name!r}\")\n    return name\n\n# In __init__(): validate before use\nself.keyspace = _validate_cql_identifier(self.keyspace)\nself.table = _validate_cql_identifier(self.table)\n```\n\n![PoC](https://raw.githubusercontent.com/n0z0/cve-evidence/main/2026-04/20260403_004238_glances_cassandra_cql_injection_poc.png)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "glances"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.5.4"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/nicolargo/glances/security/advisories/GHSA-grp3-h8m8-45p7"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-35588"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nicolargo/glances/commit/d339181f03a14bb15506307e9d58f876e23d8160"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nicolargo/glances/commit/e41b665576f9fd5374e3152078726cc59a01e48c"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/nicolargo/glances"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-89" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-21T15:18:58Z",
    "nvd_published_at" : "2026-04-21T00:16:29Z"
  }
}