Skip to content
FlawDB
Sign in
Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

CVE-2026-58225

LOW 2.1EPSS 11%

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

Mitigation

  • Upgrade postgrex to 0.22.3 or later.
  • Vendor workaround: Validate channel names before passing untrusted input to Postgrex.Notifications.listen/3. Reject any name that contains the dollar-quote delimiter ($$), or restrict channel names to a safe character set such as alphanumeric characters and underscores.

Who should check

  • Anyone running elixir-ecto postgrex >= 0.16.0, < 0.22.3
  • Anyone running elixir-ecto postgrex >= 266b530faf9bde094e31e0e4ab851f933fadc0f5, < *

Vulnerability facts

Affected
elixir-ecto postgrex >= 0.16.0, < 0.22.3; elixir-ecto postgrex >= 266b530faf9bde094e31e0e4ab851f933fadc0f5, < *
Fixed in
elixir-ecto postgrex 0.22.3
Exploited in the wild
Not in CISA KEV
Public exploit / PoC
None known
Remote exploitation
Not remotely exploitable (local or adjacent access needed)
CVSS
2.1 (v4.0, CNA)CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:NOpen in CVSS calculator
Show all 11 CVSS metrics
  • Attack vector: Local
  • Attack complexity: Low
  • Attack requirements: Present
  • Privileges required: None
  • User interaction: None
  • Confidentiality impact: None
  • Integrity impact: None
  • Availability impact: Low
  • Confidentiality impact on other systems: None
  • Integrity impact on other systems: None
  • Availability impact on other systems: None
EPSS
0.26% chance of exploitation in 30 days (percentile 11, 2026-11-26)
CWE
CWE-89
Published
Modified

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 and fixed versions

Package / productAffectedFixedSource
elixir-ecto postgrex>= 0.16.0, < 0.22.3—cvelist
elixir-ecto postgrex>= 266b530faf9bde094e31e0e4ab851f933fadc0f5, < *—cvelist

Check your systems with an agent

Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.

Check whether anything I run is affected by CVE-2026-58225. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-58225.md
Affected: elixir-ecto postgrex >= 0.16.0, < 0.22.3; elixir-ecto postgrex >= 266b530faf9bde094e31e0e4ab851f933fadc0f5, < *
Fixed in: elixir-ecto postgrex 0.22.3

Steps:
1. Search this machine and project for elixir-ecto postgrex: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.

References

FAQ

Is CVE-2026-58225 being exploited?

There is no confirmed exploitation: CVE-2026-58225 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.26% chance of exploitation in the next 30 days (as of 2026-11-26).

How serious is CVE-2026-58225?

Low: CVSS 2.1 (v4.0, scored by CNA). Not remotely exploitable (local or adjacent access needed).

Which versions are affected by CVE-2026-58225?

elixir-ecto postgrex >= 0.16.0, < 0.22.3; elixir-ecto postgrex >= 266b530faf9bde094e31e0e4ab851f933fadc0f5, < *.

Is there a fix for CVE-2026-58225?

Yes. Fixed in elixir-ecto postgrex 0.22.3. Upgrade postgrex to 0.22.3 or later. Vendor workaround: Validate channel names before passing untrusted input to Postgrex.Notifications.listen/3. Reject any name that contains the dollar-quote delimiter ($$), or restrict channel names to a safe character set such as alphanumeric characters and underscores.

How do I check if I'm affected by CVE-2026-58225?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

Sponsors