Security mailing lists by PureSourceCode

CVE-2026-58225

LOW 2.1CVSS 4.0

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

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.

Published
10 Jul 2026
Last modified
26 Nov 2026
Assigned by
6b3ad84c-e1a6-4bf7-a703-f496b71e49db
NVD status
Deferred
Weakness
CWE-89
Also known as
EEF-CVE-2026-58225GHSA-4mw9-4qgj-m97w
Sources
NVDJSONCVE ListJSONOSV EEF-CVE-2026-58225JSON

Scores

SourceScored byVersionScoreVector / decision
NVD 6b3ad84c-e1a6-4bf7-a703-f496b71e49db (Secondary) CVSS 4.0 LOW 2.1 CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
CVE List EEF CVSS 4.0 LOW 2.1 CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N
CVE List CISA-ADP SSVC Exploitation: poc; Automatable: no; Technical Impact: partial

Affected

SourceVendor / ecosystemProduct / packageAffected versionsFixed in
CVE List https://repo.hex.pm postgrex
cpe:2.3:a:elixir-ecto:postgrex:*:*:*:*:*:*:*:*
>= 0.16.0, < 0.22.3 0.22.3
CVE List https://github.com elixir-ecto/postgrex
cpe:2.3:a:elixir-ecto:postgrex:*:*:*:*:*:*:*:*
>= 266b530faf9bde094e31e0e4ab851f933fadc0f5
OSV Hex postgrex >= 0.16.0, < 0.22.3 0.22.3

References

History

  • 26 Nov 2026 18:37 UTC · OSV: updated (other details)
  • 25 Nov 2026 20:36 UTC · CVE List: first stored (published 10 Jul 2026)
  • 25 Nov 2026 20:15 UTC · OSV: first stored (published 10 Jul 2026)
  • 25 Nov 2026 20:10 UTC · NVD: first stored (published 10 Jul 2026)
An unhandled error has occurred. Reload ×

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.