{"id":81791,"date":"2026-07-10T14:46:36","date_gmt":"2026-07-10T11:16:36","guid":{"rendered":"https:\/\/afaghhosting.net\/blog\/cve-2026-58225-sql-injection-via-unescaped-dollar-quote-in-postgrex-notifications-reconnect-replay-causes-notification-denial-of-service\/"},"modified":"2026-07-10T14:46:36","modified_gmt":"2026-07-10T11:16:36","slug":"cve-2026-58225-sql-injection-via-unescaped-dollar-quote-in-postgrex-notifications-reconnect-replay-causes-notification-denial-of-service","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/cve-2026-58225-sql-injection-via-unescaped-dollar-quote-in-postgrex-notifications-reconnect-replay-causes-notification-denial-of-service\/","title":{"rendered":"CVE-2026-58225 &#8211; SQL injection via unescaped dollar-quote in Postgrex.Notifications reconnect replay causes notification denial of service"},"content":{"rendered":"<p>CVE ID :CVE-2026-58225<\/p>\n<p>  Published : July 10, 2026, 11:16 a.m. | 32\u00a0minutes ago<\/p>\n<p>  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.<\/p>\n<p>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 &#8230; END$$). quote_channel\/1 does not escape the $$ dollar-quote delimiter that opens and closes this block.<\/p>\n<p>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.<\/p>\n<p>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.<\/p>\n<p>This issue affects postgrex: from 0.16.0 before 0.22.3.<\/p>\n<p>  Severity: 2.1 | LOW<\/p>\n<p>  Visit the link for more details, such as CVSS details, affected products, timeline, and more&#8230;\u00a0<\/p>\n","protected":false},"excerpt":{"rendered":"<p>CVE ID :CVE-2026-58225 Published : July 10, 2026, 11:16 a.m. | 32\u00a0minutes ago 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 &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26],"tags":[],"class_list":["post-81791","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/81791","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/comments?post=81791"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/81791\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=81791"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=81791"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=81791"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}