Skip to main content

postgrex CVE-2026-32687

| EUVDEUVD-2026-29477 HIGH
SQL Injection (CWE-89)
2026-05-12 EEF GHSA-r73h-97w8-m54h
7.5
CVSS 4.0 · Vendor: EEF
View

Attack ChainAIDerived

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

  1. Access
    Gain access to application interface
  2. Delivery
    Submit crafted channel name with SQL payload
  3. Exploit
    Postgrex interpolates unescaped input
  4. Execution
    PostgreSQL executes injected multi-statement SQL
  5. Impact
    Exfiltrate, 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 legitimate"; DROP TABLE users; -- to the listen function. The unescaped double-quote breaks out of the LISTEN identifier context, and the PostgreSQL simple query protocol executes the chained DROP TABLE command, destroying the users table and causing data loss and service disruption across all tenants.

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 – 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

postgrex 0.16.0 <0.22.2
postgrex 266b530faf9bde094e31e0e4ab851f933fadc0f5 <7cdedbd4316bb65f82e6a9a4f922c0ac491cb770

Affected Packages

euvd postgrex fix: 0.22.2

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

Vendor (EEF) PRIMARY 7.5 HIGH
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

Attack Vector
Local
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
High
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

2
CVSS changed
May 12, 2026 - 15:22 NVD
7.5 (HIGH)
CVE Published
May 12, 2026 - 14:18 nvd
HIGH 7.5

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

Why It Matters

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.

Business Impact: High
Compensating Controls

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

EPSS Score
0.0%
Top 96% exploitable
Threat Intel
1
1 source
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GHSA 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
Scheduled
Exploitation
None
System Exposure· derived
Small
Automatable
No
Human Impact
High
Technical Impact
Total

Priority Score

38
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +38
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.

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