CVE-2026-58225

SQL injection via unescaped dollar-quote in Postgrex.Notifications reconnect replay causes notification denial of service

LOW
2.1
CVSS Score
Published: July 10, 2026 at 10:51 AM UTC
Updated: October 24, 2026 at 11:10 PM UTC
2 products affected across 1 vendorPostgrexEcto Postgrex

Using postgrex by elixir-ecto?

Get instant alerts when new vulnerabilities affect postgrex - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
LOW2.1
Exploit prediction
EPSS 0.2%
SSVC
PoC

Description

SQL Injection vulnerability in elixir-ecto postgrex allows an attacker who can influence a LISTEN channel name to inject SQL into the reconnect replay query, causing a denial of service of the notification connection. Postgrex.Notifications sanitizes channel names with quote_channel/1, which doubles double quotes so the name is safe inside a double-quoted identifier. This protects the single-statement LISTEN and UNLISTEN paths. On every (re)connect, however, handle_connect/1 replays all registered channels at once by concatenating their LISTEN statements and wrapping them in a dollar-quoted anonymous code block (DO $$BEGIN ... END$$). quote_channel/1 does not escape the $$ dollar-quote delimiter that opens and closes this block. The listen/3 guards only reject null bytes and names longer than 63 bytes, so a channel name containing $$ passes validation unchanged. Once such a name is embedded, its $$ prematurely terminates the outer dollar-quoted string and PostgreSQL parses the remainder as additional top-level statements. Because handle_connect/1 runs on every (re)connect, the malformed replay query is rejected each time and the notification connection never re-establishes its subscriptions, silently dropping notifications for every channel sharing that connection. An application is affected when it passes untrusted input (for example a tenant or user identifier) as a channel name to Postgrex.Notifications.listen/3. The double-quote doubling prevents forming a fully valid injected statement, so arbitrary SQL execution is not possible, but the corrupted query reliably breaks the shared notification connection for all tenants, resulting in denial of service. This issue affects postgrex: from 0.16.0 before 0.22.3.

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

All versions0.16.0266b530faf9bde094e31e0e4ab851f933fadc0f5
Vendor states this is fixed in 795c6062f62c4394272ff4b89170688857b4f841 (fixed)
Affected range stops below 0.22.3, so it looks safe — our inference, not a vendor statement
0.16.0 ≤ v < 0.22.30.16.0266b530faf9bde094e31e0e4ab851f933fadc0f5
Vendor states this is fixed in 795c6062f62c4394272ff4b89170688857b4f841 (fixed)
Affected range stops below 0.22.3, so it looks safe — our inference, not a vendor statement

Remediation

No guide yet

No remediation guidance has been written for this CVE yet. What the record does show:

SSVC — Action Prioritization

SSVCPoCNot automatablePartial impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

2.1LOWEEF
Vector?

Quick Info

StatusDEFERRED
CWE
CWE-89

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card