Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessGain access to application interface
-
DeliverySubmit crafted channel name with SQL payload
-
ExploitPostgrex interpolates unescaped input
-
ExecutionPostgreSQL executes injected multi-statement SQL
-
ImpactExfiltrate, modify, or destroy database objects
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 | Attacker must control or influence the channel name string parameter passed to Postgrex.Notifications.listen/3, unlisten/3, or provided during connection initialization that triggers handle_connect/1 replay logic. Requires application architecture that accepts external input (user-supplied data, API parameters, configuration files modifiable by untrusted actors) for constructing PostgreSQL notification channel subscriptions. Specifically affects Elixir applications using postgrex versions 0.16.0 through 0.22.1 with the Notifications module for pub/sub functionality. Does NOT require the attacker to have direct database access, network access to PostgreSQL, or authenticated PostgreSQL credentials-the vulnerability exists at the application/driver layer before database authentication. The CVSS local attack vector (AV:L) likely refers to requiring access to application logic or APIs that invoke these functions, not physical host access. |
| Impact | Real-world risk assessment reveals significant nuance. The CVSS v4.0 score of 7.5 (High) with vector AV:L/AC:L/PR:N indicates local attack vector with low complexity and no privileges required, yet the vulnerability requires the attacker to control or influence the channel name parameter passed to listen/unlisten functions-a condition typical in multi-tenant environments or applications accepting external input for notification subscriptions. The local attack vector (AV:L) classification appears inconsistent with the described SQL injection impact, suggesting the scoring may reflect attacker proximity to the application layer rather than network accessibility. No CISA KEV listing or EPSS data indicates this is not currently exploited in widespread campaigns. The publicly available patch commit exposes exact exploitation mechanics, lowering the barrier for adversaries to develop exploits. However, exploitability depends heavily on application architecture: if channel names are hardcoded or derived from trusted sources, realistic risk is low despite high CVSS. Conversely, SaaS platforms or multi-tenant systems allowing user-defined notification channels face immediate critical risk of data exfiltration, manipulation, or destruction. The vulnerability enables full database compromise with confidentiality, integrity, and availability impacts all rated High in CVSS, but actual impact depends on database permissions of the postgrex connection user. |
| Exploit ScenarioDerived | An attacker controlling channel name input to a multi-tenant SaaS application exploiting postgrex notifications submits a crafted channel name such as |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – May 12, 2026
SQL injection in the Elixir postgrex library allows local attackers with control over PostgreSQL LISTEN/UNLISTEN channel names to execute arbitrary SQL commands including DDL and DML operations. The Postgrex.Notifications module (versions 0.16.0 through 0.22.1) fails to escape double-quote characters in channel arguments, enabling attackers to break out of quoted identifiers and chain multi-statement payloads such as DROP TABLE commands. Vendor patch available in version 0.22.2 per GitHub advisory GHSA-r73h-97w8-m54h. No public exploit code or CISA KEV listing identified at time of analysis, though the technical details and patch diff are publicly disclosed.
RemediationAI
Upgrade postgrex to version 0.22.2 or later, which implements proper SQL identifier escaping and input validation per commit 7cdedbd4316bb65f82e6a9a4f922c0ac491cb770 available at https://github.com/elixir-ecto/postgrex/commit/7cdedbd4316bb65f82e6a9a4f922c0ac491cb770. Consult the official GitHub security advisory at https://github.com/elixir-ecto/ecto/security/advisories/GHSA-r73h-97w8-m54h for version-specific guidance. For environments unable to immediately upgrade, implement application-layer input validation: restrict channel names to alphanumeric characters and hyphens using regex pattern ^[a-zA-Z0-9_-]+$, enforce maximum 63-byte length, and reject any input containing double-quotes or null bytes before passing to listen/unlisten functions (note this workaround prevents legitimate use of special characters in channel names). Alternatively, maintain an allowlist of permitted channel names hardcoded in application logic, though this eliminates dynamic channel subscription capabilities. Review database user permissions for the postgrex connection to implement least-privilege access, limiting blast radius of successful SQL injection to non-critical tables and operations where feasible, though this compensating control does not prevent exploitation.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The postgrex library is the PostgreSQL database driver for the Elixir programming language, part of the elixir-ecto ecosystem. The vulnerability (CWE-89: SQL Injection) exists in the Postgrex.Notifications module within lib/postgrex/notifications.ex, specifically affecting the listen/3, unlisten/3, and handle_connect/1 functions. These functions construct LISTEN and UNLISTEN SQL commands by directly interpolating user-controlled channel names into quoted identifier strings without escaping the double-quote character. PostgreSQL's simple query protocol, used by the notifications connection, accepts multi-statement SQL separated by semicolons, enabling attackers to append arbitrary DDL and DML commands after breaking out of the identifier context with an unescaped quote. The patch implements proper quote escaping by replacing double-quotes with doubled double-quotes (standard SQL identifier escaping) and adds input validation rejecting null bytes and channel names exceeding PostgreSQL's 63-byte identifier limit.
Know when Postgrex 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
CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
Primary rating from Vendor (EEF) · only source for this CVE.
CVSS VectorVendor: EEF
Lifecycle Timeline
2DescriptionCVE.org
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') vulnerability in elixir-ecto postgrex ('Elixir.Postgrex.Notifications' module) allows SQL Injection.
The channel argument passed to 'Elixir.Postgrex.Notifications':listen/3 and 'Elixir.Postgrex.Notifications':unlisten/3 is interpolated directly into LISTEN "..." / UNLISTEN "..." SQL statements without escaping the " character. An attacker who can influence the channel name can inject a " to break out of the quoted identifier and append arbitrary SQL. Because the notifications connection uses the PostgreSQL simple query protocol, multi-statement payloads are accepted, allowing DDL and DML commands to be chained (e.g. ; DROP TABLE ...; --). The same unsanitized interpolation also occurs in handle_connect/1 when replaying LISTEN commands after a reconnect.
This vulnerability is associated with program file lib/postgrex/notifications.ex and program routines 'Elixir.Postgrex.Notifications':listen/3, 'Elixir.Postgrex.Notifications':unlisten/3, 'Elixir.Postgrex.Notifications':handle_connect/1.
This issue affects postgrex: from 0.16.0 before 0.22.2, from pkg:github/elixir-ecto/postgrex@266b530faf9bde094e31e0e4ab851f933fadc0f5 before 0.22.2.
Executive ViewAI
Elixir postgrex library versions 0.16.0-0.22.1 contain a SQL injection vulnerability in the Notifications module that allows local attackers to execute arbitrary database commands, including table deletion, by manipulating PostgreSQL channel names. Organizations using affected versions risk unauthorized data destruction and database compromise if applications process untrusted channel identifiers.
Vendor-released patch: postgrex 0.22.2. If immediate patching is not feasible, restrict application database user privileges to remove DDL permissions (DROP, ALTER, CREATE) and limit LISTEN/UNLISTEN operations to hard-coded, administrator-controlled channel names only. Implement database activity monitoring to detect anomalous SQL patterns.
Threat Intelligence Overview
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.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
SQL injection exploits the way applications construct database queries by mixing user input directly into SQL statements.
EUVD-2026-29477
GHSA-r73h-97w8-m54h
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB