CVE-2026-58225 Details
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.
A SQL injection vulnerability has been identified in the Postgrex library, specifically within the Notifications module. This issue allows an attacker to inject SQL by manipulating a LISTEN channel name, which disrupts the notification connection by causing a denial-of-service condition. The vulnerability arises because channel names are not properly sanitized to escape PostgreSQL's dollar-quote delimiter, enabling the injection of malformed SQL that is rejected during the reconnection process, thereby dropping notifications for all channels on that connection.
Users can upgrade to Postgrex version 0.22.3 or later, where this vulnerability has been patched. Alternatively, channel names can be validated to reject any that contain the dollar-quote delimiter or restricted to a safe character set before being passed to the listen function.
Metrics
CVSS 4.0 Severity and Vector Strings:
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
Volerion
Assessed Jul 10, 2026CISA-ADP
Assessed Jul 10, 2026References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://github.com/elixir-ecto/ecto/security/advisories/GHSA-4mw9-4qgj-m97w | CISA-ADP | AdvisoryExploitRemedyVendor |
| https://cna.erlef.org/cves/CVE-2026-58225.html | EEF | AdvisoryRemedy |
| https://github.com/elixir-ecto/ecto/security/advisories/GHSA-4mw9-4qgj-m97w | EEF | AdvisoryExploitRemedyVendor |
| https://github.com/elixir-ecto/postgrex/commit/795c6062f62c4394272ff4b89170688857b4f841 | EEF | Source CodeVendor |
| https://osv.dev/vulnerability/EEF-CVE-2026-58225 | EEF | AdvisoryBundle |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | EEF |
Affected Products
| Product | Versions |
|---|---|
| elixir-ecto Postgrex | >= 0.16.0, < 0.22.3 (semver) |
CPE
Remediation
| |
Change History
2 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jul 10, 2026 | CVE Modified | CISA-ADP |
| Jul 10, 2026 | New CVE Received | EEF |
Volerion