CVE-2026-34400: 
Python vulnerability analysis and mitigation

Overview

CVE-2026-34400 is a SQL injection vulnerability in Alerta, an open-source monitoring tool, affecting all versions prior to 9.1.0. The vulnerability exists in the Query string search API (q= parameter), where the PostgreSQL query parser built SQL WHERE clauses by interpolating user-supplied search terms directly into SQL strings using Python f-strings. It was disclosed on March 31, 2026, with a patch released in version 9.1.0. The vulnerability carries a CVSS v3.1 base score of 9.8 (Critical) (GitHub Advisory, Feedly).

Technical details

The root cause is CWE-89 (Improper Neutralization of Special Elements used in an SQL Command), specifically in the PostgreSQL backend's SearchTerm.__repr__() method, which used Python f-strings to interpolate user-supplied search terms directly into SQL query strings without sanitization or parameterization. An attacker could craft a malicious q= parameter value — for example, name:/''; DROP TABLE alerts;--/ — which would break out of the SQL string literal context and execute arbitrary SQL against the PostgreSQL database. The MongoDB backend was not affected, as its query parser outputs JSON dictionaries consumed by PyMongo's BSON encoder rather than constructing raw SQL strings. No authentication or special privileges are required to reach the vulnerable endpoint (GitHub Advisory, Fix PR #2040).

Impact

Successful exploitation allows an unauthenticated remote attacker to read, modify, or delete data in the underlying PostgreSQL database, which may contain sensitive monitoring alert data, credentials, and configuration. An attacker could also potentially escalate to operating system command execution via PostgreSQL features (e.g., COPY TO/FROM, pg_read_file), depending on database user privileges. The CVSS v3.1 score reflects high impact to confidentiality, integrity, and availability (GitHub Advisory, Feedly).

Exploitability

No public proof-of-concept exploit code has been identified, and there is no evidence of in-the-wild exploitation at this time (Feedly). The vulnerability is remotely exploitable with no authentication, no user interaction, and low attack complexity, making it trivially weaponizable once targeted. The EPSS score is approximately 0.012% (0.000120), indicating currently low predicted exploitation probability. No threat actor attribution or CISA KEV catalog listing has been reported.

Exploitation steps

  1. Reconnaissance: Identify internet-facing Alerta instances using Shodan, Censys, or similar tools by searching for the Alerta web UI or API endpoints. Confirm the backend is PostgreSQL (MongoDB deployments are not affected).
  2. Identify the vulnerable endpoint: Locate the alerts query API, typically accessible at GET /api/alerts?q=<search_term>.
  3. Craft a SQL injection payload: Construct a malicious q= parameter value that breaks out of the SQL string context. For example: name:/''; DROP TABLE alerts;--/ which the Postgres parser would render as: "name" ~* ''; DROP TABLE alerts;--'
  4. Send the malicious request: Issue an HTTP GET request to the Alerta API with the crafted payload, e.g., GET /api/alerts?q=name:/'%3B+DROP+TABLE+alerts%3B--/
  5. Achieve SQL execution: The injected SQL executes in the context of the PostgreSQL database user, enabling data exfiltration (SELECT), data manipulation (INSERT/UPDATE/DELETE), or further escalation depending on database permissions (GitHub Advisory, Fix PR #2040).

Indicators of compromise

  • Network: Unusual or malformed HTTP GET requests to /api/alerts with q= parameters containing SQL metacharacters such as single quotes ('), semicolons (;), SQL keywords (DROP, SELECT, INSERT, UNION, --), or regex-style payloads (e.g., name:/'...'/).
  • Logs: Alerta API access logs showing repeated or anomalous requests to the /api/alerts endpoint with complex or encoded q= parameter values; PostgreSQL logs showing unexpected SQL syntax errors or unusual query patterns originating from the Alerta database user.
  • Database: Unexpected schema changes (e.g., missing or altered tables), unauthorized data modifications, or new database objects (functions, roles) created by the Alerta service account.
  • Process: Unexpected child processes spawned by the PostgreSQL server process (indicative of OS command execution via COPY or pg_exec if database privileges allow) (GitHub Advisory, Fix PR #2040).

Mitigation and workarounds

Upgrade Alerta to version 9.1.0 or later, which replaces f-string interpolation with parameterized queries using %(name)s placeholders passed to psycopg2's cursor.execute(), fully preventing SQL injection through the ?q= parameter (GitHub Advisory, Fix Commit). If immediate patching is not possible, deploy a reverse proxy or WAF in front of the Alerta API to sanitize or block requests containing SQL metacharacters in the q= parameter. Additionally, restrict network-level access to the Alerta API to trusted IP ranges and review PostgreSQL database user privileges to apply the principle of least privilege.

Additional resources


Source: This report was generated using AI

Related Python vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

GHSA-v2f8-6655-7grjCRITICAL10
  • Python logoPython
  • vibe-trading-ai
NoYesOct 02, 2026
CVE-2026-105782HIGH7.5
  • Python logoPython
  • scrapy
NoYesOct 06, 2026
GHSA-v853-p72q-4cfwHIGH7.5
  • Python logoPython
  • quart
NoYesOct 05, 2026
CVE-2026-105751MEDIUM6.9
  • Python logoPython
  • docling
NoYesOct 05, 2026
CVE-2026-105750MEDIUM5.9
  • Python logoPython
  • docling
NoYesOct 05, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management