Skip to main content

Python CVE-2026-32611

HIGH
SQL Injection (CWE-89)
2026-03-16 https://github.com/nicolargo/glances GHSA-49g7-2ww7-3vf5
7.0
CVSS 3.1 · GitHub Advisory
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Craft malicious metric names
  2. Exploit
    Glances collects monitoring data
  3. Execution
    DuckDB module interpolates names into SQL DDL
  4. Impact
    SQL injection executes arbitrary queries

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Parameterized queries, prepared statements
MITRE ATT&CK

2 techniques across 2 tactics: Initial Access, Persistence

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Glances must be configured with DuckDB export module enabled (glances_duckdb plugin active). Attacker must be able to influence monitored metric names or system statistics that Glances processes and exports to DuckDB. No authentication required for network access to Glances monitoring interface.

Impact

The CVSS 3.1 score of 7.0 (High) reflects a network-accessible vulnerability with high attack complexity that requires no privileges or user interaction, potentially impacting confidentiality significantly while having limited impact on integrity and availability. The high attack complexity (AC:H) is justified because exploitation requires either a malicious plugin or future code changes that introduce dynamic stat keys from external sources. With no EPSS data, KEV listing, or known exploitation in the wild, this appears to be a defense-in-depth issue with limited immediate exploitability. The primary risk is future exploitability if Glances plugins are extended to accept user-controlled metric names, making this more of a security debt issue than an immediate threat.

Exploit ScenarioDerived

An attacker would need to introduce a malicious Glances plugin or modify an existing plugin to generate stat dictionary keys containing SQL metacharacters like 'cpu_percent BIGINT); DROP TABLE cpu; --'. When the DuckDB export module processes these stats, the malicious SQL would be executed during table creation, potentially dropping existing tables or creating unauthorized database objects. The high attack complexity stems from the requirement to either compromise the Glances installation to add malicious plugins or wait for legitimate plugins that process external user data, making this a theoretical rather than immediately exploitable vulnerability.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Mar 16, 2026

SQL injection in Python's Glances DuckDB export module allows unauthenticated remote attackers to execute arbitrary SQL commands by injecting malicious data through unparameterized table and column name interpolation in DDL statements. While INSERT values use parameterized queries, identifier names are directly embedded via f-strings, enabling attackers over the network to manipulate database structure and access sensitive monitoring data. A patch is available.

Earlier versions of this analysis (1)
v1 Mar 16, 2026 - 17:20 CVSS 7.0

A SQL injection vulnerability exists in the DuckDB export module of Glances system monitoring tool, where table and column names derived from monitoring statistics are directly interpolated into SQL statements via f-strings without proper sanitization. This vulnerability affects Glances versions prior to 4.5.2 and could allow an attacker who can control plugin names or stat dictionary keys to execute arbitrary SQL commands against the DuckDB database, potentially corrupting data or creating unauthorized tables. A patch is available in version 4.5.2, and while no active exploitation has been reported, the vulnerability represents an incomplete fix from a previous similar issue in the TimescaleDB module.

RemediationAI

Upgrade Glances to version 4.5.2 or later, which includes the fix that properly quotes SQL identifiers in the DuckDB export module. The patch implements a _quote_identifier function that escapes double quotes in identifier names, preventing SQL injection. If immediate patching is not possible, consider disabling the DuckDB export functionality in glances.conf or ensuring that only trusted, built-in plugins are used without any custom plugins that might introduce dynamic stat keys. Monitor the vendor's security advisories at https://github.com/nicolargo/glances/security/advisories for any additional guidance.

Affected Packages

pypi glances fix: 4.5.2

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in pypi

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

The vulnerability affects the Glances Python package (pkg:pip/glances), specifically in the DuckDB export module located at glances/exports/glances_duckdb/__init__.py. This is a classic SQL injection vulnerability (CWE-89) where user-controllable data is concatenated directly into SQL statements using Python f-strings instead of using parameterized queries or proper identifier escaping. While the INSERT values correctly use parameterized placeholders (?), the table names and column names in CREATE TABLE and INSERT INTO statements are directly interpolated, creating an injection vector if any plugin introduces dynamic keys from external data sources.

Know when Python gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

GitHub Advisory PRIMARY 7.0 HIGH
AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:L
SUSE 9.1 CRITICAL
AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:L

Primary rating from GitHub Advisory.

CVSS VectorGitHub Advisory

Attack Vector
Network
Attack Complexity
High
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
Low
Availability
Low

Lifecycle Timeline

2
Patch released
Mar 16, 2026 - 17:20 nvd
Patch available
CVE Published
Mar 16, 2026 - 16:34 nvd
HIGH 7.0

DescriptionGitHub Advisory

Summary

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.

Details

The DuckDB export module constructs SQL DDL statements by directly interpolating stat field names and plugin names into f-strings.

Vulnerable CREATE TABLE construction (glances/exports/glances_duckdb/__init__.py:156-162):

python
create_query = f"""
CREATE TABLE {plugin} (
{', '.join(creation_list)}
);"""
self.client.execute(create_query)

The creation_list is built from stat dictionary keys in the update() method (glances/exports/glances_duckdb/__init__.py:117-118):

python
for key, value in plugin_stats.items():
    creation_list.append(f"{key} {convert_types[type(self.normalize(value)).__name__]}")

The INSERT statement also uses the unescaped plugin name (glances/exports/glances_duckdb/__init__.py:172-174):

python
insert_query = f"""
INSERT INTO {plugin} VALUES (
{', '.join(['?' for _ in values])}
);"""

While INSERT values use ? placeholders (safe), the table name {plugin} is directly interpolated in both CREATE TABLE and INSERT INTO statements. Column names in creation_list are also directly interpolated without quoting.

Comparison with the TimescaleDB fix (commit 39161f0):

The TimescaleDB fix addressed this exact pattern by:

  1. Using psycopg.sql.Identifier() for table and column names
  2. Using psycopg.sql.SQL() for composing queries
  3. Using %s placeholders for all values

The DuckDB module was not part of this fix despite having the same vulnerability class.

Attack vector:

The primary attack vector is through stat dictionary keys. While most keys come from hardcoded psutil field names (e.g., cpu_percent, memory_usage), any future plugin that introduces dynamic keys from external data (container labels, custom metrics, user-defined sensor names) would create an exploitable injection path. Additionally, the table name (plugin) comes from the internal plugins list, but any custom plugin with a crafted name could inject SQL.

PoC

The injection is demonstrable when column or table names contain SQL metacharacters:

python
# Simulated injection via a hypothetical plugin with dynamic keys
# If a stat dict contained a key like:
#   "cpu_percent BIGINT); DROP TABLE cpu; --"
# The creation_list would produce:
#   "cpu_percent BIGINT); DROP TABLE cpu; -- VARCHAR"
# Which in the CREATE TABLE f-string becomes:
#   CREATE TABLE plugin_name (
#     time TIMETZ,
#     hostname_id VARCHAR,
#     cpu_percent BIGINT); DROP TABLE cpu; -- VARCHAR
#   );
bash
# Verify with DuckDB export enabled:
# 1. Configure DuckDB export in glances.conf:
# [duckdb]
# database=/tmp/glances.duckdb
# 2. Start Glances with DuckDB export and debug logging
glances --export duckdb --debug 2>&1 | grep "Create table"
# 3. Observe the unescaped SQL in debug output

Impact

  • Defense-in-depth gap: The identical vulnerability pattern was identified and fixed in TimescaleDB (GHSA-x46r) but the fix was not applied to the sibling DuckDB module. This represents an incomplete patch that leaves the same attack surface open through a different code path.
  • Future exploitability: If any Glances plugin is added or modified to produce stat dictionary keys from external/user-controlled data (e.g., container metadata, custom metric names, SNMP OID labels), the DuckDB export would become immediately exploitable for SQL injection without any additional code changes.
  • Data integrity: A successful injection in the CREATE TABLE statement could corrupt the DuckDB database, create unauthorized tables, or modify schema in ways that affect other applications reading from the same database file.

Recommended Fix

Apply the same parameterization approach used in the TimescaleDB fix. DuckDB supports identifier quoting with double quotes:

python
# glances/exports/glances_duckdb/__init__.py

def _quote_identifier(name):
    """Quote a SQL identifier to prevent injection."""
# DuckDB uses double-quote escaping for identifiers
    return '"' + name.replace('"', '""') + '"'

def export(self, plugin, creation_list, values_list):
    """Export the stats to the DuckDB server."""
    logger.debug(f"Export {plugin} stats to DuckDB")

    table_list = [t[0] for t in self.client.sql("SHOW TABLES").fetchall()]
    if plugin not in table_list:
# Quote table and column names to prevent injection
        quoted_plugin = _quote_identifier(plugin)
        quoted_fields = []
        for item in creation_list:
            parts = item.split(' ', 1)
            col_name = _quote_identifier(parts[0])
            col_type = parts[1] if len(parts) > 1 else 'VARCHAR'
            quoted_fields.append(f"{col_name} {col_type}")

        create_query = f"CREATE TABLE {quoted_plugin} ({', '.join(quoted_fields)});"
        try:
            self.client.execute(create_query)
        except Exception as e:
            logger.error(f"Cannot create table {plugin}: {e}")
            return

    self.client.commit()
# Insert with quoted table name
    quoted_plugin = _quote_identifier(plugin)
    for values in values_list:
        insert_query = f"INSERT INTO {quoted_plugin} VALUES ({', '.join(['?' for _ in values])});"
        try:
            self.client.execute(insert_query, values)
        except Exception as e:
            logger.error(f"Cannot insert data into table {plugin}: {e}")

    self.client.commit()

Executive ViewAI

Why It Matters

A SQL injection vulnerability exists in Glances' DuckDB export module that could allow attackers to execute arbitrary SQL commands and potentially access or manipulate monitoring data stored in DuckDB databases. Organizations using Glances with DuckDB export functionality are at risk of unauthorized data access or database compromise. A patch is available and should be applied immediately to eliminate this exposure.

Business Impact: High
Compensating Controls

Apply vendor patch. If immediate patching is not feasible, interim mitigations include: (1) disable DuckDB export functionality in Glances configuration until patched, (2) restrict network access to DuckDB database files using OS-level file permissions and network segmentation, (3) implement database access logging and monitoring for suspicious SQL patterns, and (4) isolate Glances instances to trusted internal networks only.

Threat Intelligence Overview

EPSS Score
0.0%
Top 99% exploitable
Data Quality
5 sources
Confidence: Medium
NVD CVE.org EPSS Vendor GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact
High

Priority Score

35
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +35
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

SQL injection exploits the way applications construct database queries by mixing user input directly into SQL statements.

Affected Products (CPE)GitHub Advisory

pkg:pip/glances

More in Python

View all
CVE-2025-24016 CRITICAL POC
9.9 Feb 10

Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t

CVE-2025-27520 CRITICAL POC
9.8 Apr 04

BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser

CVE-2025-2945 CRITICAL POC
9.9 Apr 03

pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi

CVE-2013-5093 MEDIUM POC
6.8 Sep 27

The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python

CVE-2025-32375 CRITICAL POC
9.8 Apr 09

BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica

CVE-2014-0224 HIGH POC
7.4 Jun 05

OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph

CVE-2024-21644 HIGH POC
7.5 Jan 08

pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.

CVE-2026-33017 CRITICAL POC
9.3 Mar 17

Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301

CVE-2017-9462 HIGH POC
8.8 Jun 06

In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse

CVE-2026-49869 CRITICAL POC
10.0 Jun 26

Unauthenticated remote code execution affects Kestra OSS (the open-source event-driven orchestration platform) prior to

CVE-2026-39987 CRITICAL POC
9.3 Apr 08

Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/

CVE-2024-21645 MEDIUM POC
5.3 Jan 08

pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne

Vendor StatusVendor

SUSE

Severity: Critical
Product Status
openSUSE Tumbleweed Fixed

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy