CVE-2026-30930: Glances has SQL Injection via Process Names in TimescaleDB Export

Published Mar 9, 2026
·
Updated

Summary

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.

Root 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.

Affected Code - File: glances/exports/glancestimescaledb/init.py, lines 79-93 (normalize function) def normalize(self, value): """Normalize the value to be exportable to TimescaleDB.""" if value is None: return 'NULL' if isinstance(value, bool): return str(value).upper() if isinstance(value, (list, tuple)): # Special case for list of one boolean if len(value) == 1 and isinstance(value[0], bool): return str(value[0]).upper() return ', '.join([f"'{v}'" for v in value]) if isinstance(value, str): return f"'{value}'" # <-- NO ESCAPING of single quotes within value

return f"{value}"

- File: glances/exports/glancestimescaledb/init.py, lines 201-205 (query construction) Insert the data insertlist = [f"({','.join(i)})" for i in valueslist] insertquery = f"INSERT INTO {plugin} VALUES {','.join(insertlist)};" logger.debug(f"Insert data into table: {insertquery}") try: cur.execute(insertquery) # <-- Direct execution of concatenated SQL

PoC - As a normal user, create a process with the name containing the SQL Injection payload: exec -a "x'); COPY (SELECT version()) TO '/tmp/sqliproof.txt' --" python3 -c 'import time; [sum(range(500000)) or time.sleep(0.01) for in iter(int, 1)]' - Start Glances with TimescaleDB export as root user: glances --export timescaledb --export-process-filter "." --time 5 --stdout cpu - Observe that sqliproof.txt is created in /tmp directory.

Impact

- Data Destruction: DROP TABLE, DELETE, TRUNCATE operations against the TimescaleDB database. - Data Exfiltration: Using COPY ... TO or subqueries to extract data from other tables. - Potential RCE: Via PostgreSQL extensions like COPY ... PROGRAM which executes OS commands. - 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.

Other sources

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.

MITRE

Affected Software

2 affected componentsFixes available
pip/Glances<4.5.1
4.5.1
nicolargo Glances<4.5.1

Event History

Mar 9, 2026
Advisory Published
via GitHub·07:51 PM
Data Sourced
via GitHub·07:51 PM
DescriptionWeaknessAffected Software
Mar 10, 2026
CVE Published
via MITRE·04:16 PM
Data Sourced
via MITRE·04:16 PM
DescriptionWeakness
Data Sourced
via NVD·06:18 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·06:18 PM
RemedyAffected Software
Jul 2, 58187
Event
via NVD·07:37 PM
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-30930?

CVE-2026-30930 is categorized as a critical vulnerability due to the potential for SQL injection attacks.

2

How do I fix CVE-2026-30930?

To fix CVE-2026-30930, update Glances to version 4.5.1 or later, which includes the necessary patch.

3

What are the consequences of CVE-2026-30930?

Exploitation of CVE-2026-30930 can lead to unauthorized database access and manipulation through SQL injection.

4

Which versions of Glances are affected by CVE-2026-30930?

CVE-2026-30930 affects all versions of Glances prior to 4.5.1.

5

How does CVE-2026-30930 occur in Glances?

CVE-2026-30930 occurs due to SQL queries being constructed using unsanitized data, creating risks for SQL injection.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203