GHSA-grp3-h8m8-45p7

Suggest an improvement
Source
https://github.com/advisories/GHSA-grp3-h8m8-45p7
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/04/GHSA-grp3-h8m8-45p7/GHSA-grp3-h8m8-45p7.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-grp3-h8m8-45p7
Aliases
  • CVE-2026-35588
Published
2026-04-21T15:18:58Z
Modified
2026-04-21T15:41:14.395820Z
Severity
  • 6.3 (Medium) CVSS_V3 - CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:L CVSS Calculator
Summary
Glances has CQL Injection in its Cassandra Export Module via Unsanitized Config Values
Details

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

# 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:
    [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

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

Database specific
{
    "github_reviewed": true,
    "nvd_published_at": "2026-04-21T00:16:29Z",
    "cwe_ids": [
        "CWE-89"
    ],
    "github_reviewed_at": "2026-04-21T15:18:58Z",
    "severity": "MODERATE"
}
References

Affected packages

PyPI / glances

Package

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
4.5.4

Affected versions

1.*
1.3.1
1.3.2
1.3.3
1.3.4
1.3.5
1.3.6
1.3.7
1.4
1.4.1
1.4.1.1
1.4.2
1.4.2.1
1.5
1.5.1
1.5.2
1.6
1.6.1
1.7
1.7.1
1.7.2
1.7.3
1.7.4
1.7.5
1.7.6
1.7.7
2.*
2.0
2.0.1
2.1
2.1.1
2.1.2
2.2
2.2.1
2.3
2.4
2.4.1
2.4.2
2.5
2.5.1
2.6
2.6.1
2.6.2
2.7
2.7.1
2.8
2.8.1
2.8.2
2.8.3
2.8.4
2.8.5
2.8.6
2.8.7
2.8.8
2.9.0
2.9.1
2.10
2.11
2.11.1
3.*
3.0
3.0.1
3.0.2
3.1.0
3.1.1
3.1.2
3.1.3
3.1.4
3.1.4.1
3.1.5
3.1.6
3.1.6.1
3.1.6.2
3.1.7
3.2.0
3.2.1
3.2.2
3.2.3
3.2.3.1
3.2.4
3.2.4.1
3.2.4.2
3.2.5
3.2.6.1
3.2.6.2
3.2.6.3
3.2.6.4
3.2.7
3.3.0
3.3.0.1
3.3.0.2
3.3.0.3
3.3.0.4
3.3.1
3.3.1.1
3.4.0
3.4.0.1
3.4.0.2
3.4.0.3
3.4.0.4
3.4.0.5
4.*
4.0.1
4.0.2
4.0.3
4.0.4
4.0.5
4.0.6
4.0.7
4.0.8
4.1.0
4.1.1
4.1.2
4.2.0
4.2.1
4.3.0
4.3.0.1
4.3.0.3
4.3.0.4
4.3.0.5
4.3.0.6
4.3.0.7
4.3.0.8
4.3.1
4.3.2
4.3.3
4.4.0
4.4.1
4.5.0
4.5.0.1
4.5.0.2
4.5.0.3
4.5.0.4
4.5.0.5
4.5.1
4.5.2
4.5.3

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/04/GHSA-grp3-h8m8-45p7/GHSA-grp3-h8m8-45p7.json"