{"id":"CVE-2026-35588","aliases":["CVE-2026-35588","GHSA-grp3-h8m8-45p7","PYSEC-2026-2177"],"related":[],"kind":"vulnerability","state":"published","title":"Glances has CQL Injection in its Cassandra Export Module via Unsanitized Config Values","summary":"Glances is an open-source system cross-platform monitoring tool. Prior to version 4.5.4, 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. Version 4.5.4 contains a fix.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Glances is an open-source system cross-platform monitoring tool. Prior to version 4.5.4, 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. Version 4.5.4 contains a fix.","source":"cvelist"},{"lang":"en","text":"## 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)","format":"markdown","source":"ghsa"},{"lang":"es","text":"Glances es una herramienta de monitorización de sistemas multiplataforma de código abierto. Antes de la versión 4.5.4, el módulo de exportación de Cassandra (glances/exports/glances_cassandra/__init__.py) interpola los valores de configuración ’keyspace’, ’table’ y ’replication_factor’ directamente en las sentencias CQL sin validación. Un usuario con acceso de escritura a ’glances.conf’ puede redirigir todos los datos de monitorización a un keyspace de Cassandra controlado por un atacante. La versión 4.5.4 contiene una corrección.","source":"nvd"}],"published":"2026-04-20T23:20:34.998Z","modified":"2026-10-26T22:10:00.163Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:L","score":6.3,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:L","score":6.3,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:L","score":6.3,"rating":"MEDIUM"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:L","score":6.3,"rating":"MEDIUM"}],"cwes":["CWE-89"],"affected":[{"ranges":[{"version":"< 4.5.4","status":"affected"}],"vendor":"nicolargo","product":"glances","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"4.5.4"}],"ecosystem":"PyPI","package":"glances","purl":"pkg:pypi/glances","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"4.5.4"}],"vendor":"nicolargo","product":"glances","cpe":"cpe:2.3:a:nicolargo:glances:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"4.5.4"}],"ecosystem":"PyPI","package":"glances","purl":"pkg:pypi/glances","source":"pysec"}],"references":[{"url":"https://github.com/nicolargo/glances/security/advisories/GHSA-grp3-h8m8-45p7","tags":["evidence","exploit","mitigation","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/nicolargo/glances/commit/d339181f03a14bb15506307e9d58f876e23d8160","tags":["fix","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/nicolargo/glances/commit/e41b665576f9fd5374e3152078726cc59a01e48c","tags":["fix","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-35588","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/nicolargo/glances","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"total","date":"2026-04-21T13:35:00.699Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-35588","url":"https://www.cve.org/CVERecord?id=CVE-2026-35588","licence":"CVE Terms of Use","modified":"2026-04-21T13:35:04.526Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-grp3-h8m8-45p7","url":"https://github.com/advisories/GHSA-grp3-h8m8-45p7","licence":"CC-BY-4.0","modified":"2026-07-13T07:26:16.616Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-35588","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-35588","licence":"Public domain","modified":"2026-10-26T22:10:00.163Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-2177","url":"https://osv.dev/vulnerability/PYSEC-2026-2177","licence":"CC-BY-4.0","modified":"2026-07-13T07:15:32.942Z"}],"updatedAt":"2026-11-25T22:59:19.071Z","epss":{"score":0.0022,"percentile":0.13289,"date":"2026-12-01T12:00:22.000Z"}}