{"containers":{"adp":[{"metrics":[{"other":{"content":{"id":"CVE-2026-58225","options":[{"Exploitation":"poc"},{"Automatable":"no"},{"Technical Impact":"partial"}],"role":"CISA Coordinator","timestamp":"2026-07-10T11:47:10.671088Z","version":"2.0.3"},"type":"ssvc"}}],"providerMetadata":{"dateUpdated":"2026-07-10T11:47:16.925Z","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","shortName":"CISA-ADP"},"references":[{"tags":["exploit"],"url":"https://github.com/elixir-ecto/ecto/security/advisories/GHSA-4mw9-4qgj-m97w"}],"title":"CISA ADP Vulnrichment"}],"cna":{"affected":[{"collectionURL":"https://repo.hex.pm","cpes":["cpe:2.3:a:elixir-ecto:postgrex:*:*:*:*:*:*:*:*"],"defaultStatus":"unaffected","modules":["'Elixir.Postgrex.Notifications'"],"packageName":"postgrex","packageURL":"pkg:hex/postgrex","product":"postgrex","programFiles":["lib/postgrex/notifications.ex"],"programRoutines":[{"name":"'Elixir.Postgrex.Notifications':handle_connect/1"},{"name":"'Elixir.Postgrex.Notifications':listen/3"}],"repo":"https://github.com/elixir-ecto/postgrex","vendor":"elixir-ecto","versions":[{"lessThan":"0.22.3","status":"affected","version":"0.16.0","versionType":"semver"}]},{"collectionURL":"https://github.com","cpes":["cpe:2.3:a:elixir-ecto:postgrex:*:*:*:*:*:*:*:*"],"defaultStatus":"unaffected","modules":["'Elixir.Postgrex.Notifications'"],"packageName":"elixir-ecto/postgrex","packageURL":"pkg:github/elixir-ecto/postgrex","product":"postgrex","programFiles":["lib/postgrex/notifications.ex"],"programRoutines":[{"name":"'Elixir.Postgrex.Notifications':handle_connect/1"},{"name":"'Elixir.Postgrex.Notifications':listen/3"}],"repo":"https://github.com/elixir-ecto/postgrex","vendor":"elixir-ecto","versions":[{"lessThan":"795c6062f62c4394272ff4b89170688857b4f841","status":"affected","version":"266b530faf9bde094e31e0e4ab851f933fadc0f5","versionType":"git"}]}],"cpeApplicability":[{"nodes":[{"cpeMatch":[{"criteria":"cpe:2.3:a:elixir-ecto:postgrex:*:*:*:*:*:*:*:*","versionEndExcluding":"0.22.3","versionStartIncluding":"0.16.0","vulnerable":true}],"negate":false,"operator":"AND"}],"operator":"OR"}],"credits":[{"lang":"en","type":"finder","value":"Peter Ullrich"},{"lang":"en","type":"remediation developer","value":"José Valim"},{"lang":"en","type":"analyst","value":"Jonatan Männchen / EEF"}],"descriptions":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/html","value":"<p>SQL Injection vulnerability in elixir-ecto postgrex allows an attacker who can influence a <tt>LISTEN</tt> channel name to inject SQL into the reconnect replay query, causing a denial of service of the notification connection.</p><p><tt>Postgrex.Notifications</tt> sanitizes channel names with <tt>quote_channel/1</tt>, which doubles double quotes so the name is safe inside a double-quoted identifier. This protects the single-statement <tt>LISTEN</tt> and <tt>UNLISTEN</tt> paths. On every (re)connect, however, <tt>handle_connect/1</tt> replays all registered channels at once by concatenating their <tt>LISTEN</tt> statements and wrapping them in a dollar-quoted anonymous code block (<tt>DO $$BEGIN ... END$$</tt>). <tt>quote_channel/1</tt> does not escape the <tt>$$</tt> dollar-quote delimiter that opens and closes this block.</p><p>The <tt>listen/3</tt> guards only reject null bytes and names longer than 63 bytes, so a channel name containing <tt>$$</tt> passes validation unchanged. Once such a name is embedded, its <tt>$$</tt> prematurely terminates the outer dollar-quoted string and PostgreSQL parses the remainder as additional top-level statements. Because <tt>handle_connect/1</tt> 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><p>An application is affected when it passes untrusted input (for example a tenant or user identifier) as a channel name to <tt>Postgrex.Notifications.listen/3</tt>. 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><p>This issue affects postgrex: from 0.16.0 before 0.22.3.</p>"}],"value":"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.\n\nPostgrex.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.\n\nThe 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.\n\nAn 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.\n\nThis issue affects postgrex: from 0.16.0 before 0.22.3."}],"impacts":[{"capecId":"CAPEC-66","descriptions":[{"lang":"en","value":"CAPEC-66 SQL Injection"}]}],"metrics":[{"cvssV4_0":{"attackComplexity":"LOW","attackRequirements":"PRESENT","attackVector":"LOCAL","baseScore":2.1,"baseSeverity":"LOW","privilegesRequired":"NONE","subAvailabilityImpact":"NONE","subConfidentialityImpact":"NONE","subIntegrityImpact":"NONE","userInteraction":"NONE","vectorString":"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","version":"4.0","vulnAvailabilityImpact":"LOW","vulnConfidentialityImpact":"NONE","vulnIntegrityImpact":"NONE"},"format":"CVSS","scenarios":[{"lang":"en","value":"GENERAL"}]}],"problemTypes":[{"descriptions":[{"cweId":"CWE-89","description":"CWE-89 Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')","lang":"en","type":"CWE"}]}],"providerMetadata":{"dateUpdated":"2026-07-10T12:50:40.297Z","orgId":"6b3ad84c-e1a6-4bf7-a703-f496b71e49db","shortName":"EEF"},"references":[{"tags":["vendor-advisory","related"],"url":"https://github.com/elixir-ecto/ecto/security/advisories/GHSA-4mw9-4qgj-m97w"},{"tags":["related"],"url":"https://cna.erlef.org/cves/CVE-2026-58225.html"},{"tags":["related"],"url":"https://osv.dev/vulnerability/EEF-CVE-2026-58225"},{"tags":["patch"],"url":"https://github.com/elixir-ecto/postgrex/commit/795c6062f62c4394272ff4b89170688857b4f841"}],"source":{"discovery":"EXTERNAL"},"title":"SQL injection via unescaped dollar-quote in Postgrex.Notifications reconnect replay causes notification denial of service","workarounds":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/html","value":"<p>Validate channel names before passing untrusted input to <tt>Postgrex.Notifications.listen/3</tt>. Reject any name that contains the dollar-quote delimiter (<tt>$$</tt>), or restrict channel names to a safe character set such as alphanumeric characters and underscores.</p>"}],"value":"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."}],"x_generator":{"engine":"cvelib 1.8.0"}}},"cveMetadata":{"assignerOrgId":"6b3ad84c-e1a6-4bf7-a703-f496b71e49db","assignerShortName":"EEF","cveId":"CVE-2026-58225","datePublished":"2026-07-10T10:51:46.978Z","dateReserved":"2026-06-29T18:54:08.633Z","dateUpdated":"2026-07-10T12:50:40.297Z","state":"PUBLISHED"},"dataType":"CVE_RECORD","dataVersion":"5.2"}