{"id":"CVE-2026-32687","state":"PUBLISHED","title":"SQL injection via channel name in Postgrex.Notifications.listen/3 and unlisten/3","description":"Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') vulnerability in elixir-ecto postgrex ('Elixir.Postgrex.Notifications' module) allows SQL Injection.\n\nThe channel argument passed to 'Elixir.Postgrex.Notifications':listen/3 and 'Elixir.Postgrex.Notifications':unlisten/3 is interpolated directly into LISTEN \"...\" / UNLISTEN \"...\" SQL statements without escaping the \" character. An attacker who can influence the channel name can inject a \" to break out of the quoted identifier and append arbitrary SQL. Because the notifications connection uses the PostgreSQL simple query protocol, multi-statement payloads are accepted, allowing DDL and DML commands to be chained (e.g. ; DROP TABLE ...; --). The same unsanitized interpolation also occurs in handle_connect/1 when replaying LISTEN commands after a reconnect.\n\nThis vulnerability is associated with program file lib/postgrex/notifications.ex and program routines 'Elixir.Postgrex.Notifications':listen/3, 'Elixir.Postgrex.Notifications':unlisten/3, 'Elixir.Postgrex.Notifications':handle_connect/1.\n\nThis issue affects postgrex: from 0.16.0 before 0.22.2.","publishedAt":"2026-05-12T14:18:07.607Z","updatedAt":"2026-07-24T14:16:18.902Z","severity":{"score":7.5,"label":"High","version":"4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","source":"EEF"},"assigner":"EEF","products":["elixir-ecto postgrex"],"affected":[{"vendor":"elixir-ecto","product":"postgrex","packageName":"postgrex","packageURL":"pkg:hex/postgrex","defaultStatus":"unaffected","versions":[{"version":"0.16.0","status":"affected","lessThan":"0.22.2","versionType":"semver"}],"collectionURL":"https://repo.hex.pm","cpes":["cpe:2.3:a:elixir-ecto:postgrex:*:*:*:*:*:*:*:*"],"modules":["'Elixir.Postgrex.Notifications'"],"programFiles":["lib/postgrex/notifications.ex"],"programRoutines":[{"name":"'Elixir.Postgrex.Notifications':listen/3"},{"name":"'Elixir.Postgrex.Notifications':unlisten/3"},{"name":"'Elixir.Postgrex.Notifications':handle_connect/1"}],"repo":"https://github.com/elixir-ecto/postgrex.git"},{"vendor":"elixir-ecto","product":"postgrex","packageName":"elixir-ecto/postgrex","packageURL":"pkg:github/elixir-ecto/postgrex","defaultStatus":"unaffected","versions":[{"version":"266b530faf9bde094e31e0e4ab851f933fadc0f5","status":"affected","lessThan":"7cdedbd4316bb65f82e6a9a4f922c0ac491cb770","versionType":"git"}],"collectionURL":"https://github.com","cpes":["cpe:2.3:a:elixir-ecto:postgrex:*:*:*:*:*:*:*:*"],"modules":["'Elixir.Postgrex.Notifications'"],"programFiles":["lib/postgrex/notifications.ex"],"programRoutines":[{"name":"'Elixir.Postgrex.Notifications':listen/3"},{"name":"'Elixir.Postgrex.Notifications':unlisten/3"},{"name":"'Elixir.Postgrex.Notifications':handle_connect/1"}],"repo":"https://github.com/elixir-ecto/postgrex.git"}],"references":["https://github.com/elixir-ecto/ecto/security/advisories/GHSA-r73h-97w8-m54h","https://cna.erlef.org/cves/CVE-2026-32687.html","https://osv.dev/vulnerability/EEF-CVE-2026-32687","https://github.com/elixir-ecto/postgrex/commit/7cdedbd4316bb65f82e6a9a4f922c0ac491cb770"],"weaknesses":["CWE-89"],"ingestedAt":"2026-10-29T20:11:40.391Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/32xxx/CVE-2026-32687.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-32687","state":"PUBLISHED","datePublished":"2026-05-12T14:18:07.607Z","dateUpdated":"2026-07-24T14:16:18.902Z","assignerShortName":"EEF","assignerOrgId":"6b3ad84c-e1a6-4bf7-a703-f496b71e49db","dateReserved":"2026-03-13T09:12:14.475Z"},"containers":{"cna":{"title":"SQL injection via channel name in Postgrex.Notifications.listen/3 and unlisten/3","descriptions":[{"lang":"en","value":"Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') vulnerability in elixir-ecto postgrex ('Elixir.Postgrex.Notifications' module) allows SQL Injection.\n\nThe channel argument passed to 'Elixir.Postgrex.Notifications':listen/3 and 'Elixir.Postgrex.Notifications':unlisten/3 is interpolated directly into LISTEN \"...\" / UNLISTEN \"...\" SQL statements without escaping the \" character. An attacker who can influence the channel name can inject a \" to break out of the quoted identifier and append arbitrary SQL. Because the notifications connection uses the PostgreSQL simple query protocol, multi-statement payloads are accepted, allowing DDL and DML commands to be chained (e.g. ; DROP TABLE ...; --). The same unsanitized interpolation also occurs in handle_connect/1 when replaying LISTEN commands after a reconnect.\n\nThis vulnerability is associated with program file lib/postgrex/notifications.ex and program routines 'Elixir.Postgrex.Notifications':listen/3, 'Elixir.Postgrex.Notifications':unlisten/3, 'Elixir.Postgrex.Notifications':handle_connect/1.\n\nThis issue affects postgrex: from 0.16.0 before 0.22.2."}],"affected":[{"vendor":"elixir-ecto","product":"postgrex","packageName":"postgrex","packageURL":"pkg:hex/postgrex","defaultStatus":"unaffected","versions":[{"version":"0.16.0","status":"affected","lessThan":"0.22.2","versionType":"semver"}],"collectionURL":"https://repo.hex.pm","cpes":["cpe:2.3:a:elixir-ecto:postgrex:*:*:*:*:*:*:*:*"],"modules":["'Elixir.Postgrex.Notifications'"],"programFiles":["lib/postgrex/notifications.ex"],"programRoutines":[{"name":"'Elixir.Postgrex.Notifications':listen/3"},{"name":"'Elixir.Postgrex.Notifications':unlisten/3"},{"name":"'Elixir.Postgrex.Notifications':handle_connect/1"}],"repo":"https://github.com/elixir-ecto/postgrex.git"},{"vendor":"elixir-ecto","product":"postgrex","packageName":"elixir-ecto/postgrex","packageURL":"pkg:github/elixir-ecto/postgrex","defaultStatus":"unaffected","versions":[{"version":"266b530faf9bde094e31e0e4ab851f933fadc0f5","status":"affected","lessThan":"7cdedbd4316bb65f82e6a9a4f922c0ac491cb770","versionType":"git"}],"collectionURL":"https://github.com","cpes":["cpe:2.3:a:elixir-ecto:postgrex:*:*:*:*:*:*:*:*"],"modules":["'Elixir.Postgrex.Notifications'"],"programFiles":["lib/postgrex/notifications.ex"],"programRoutines":[{"name":"'Elixir.Postgrex.Notifications':listen/3"},{"name":"'Elixir.Postgrex.Notifications':unlisten/3"},{"name":"'Elixir.Postgrex.Notifications':handle_connect/1"}],"repo":"https://github.com/elixir-ecto/postgrex.git"}],"references":[{"url":"https://github.com/elixir-ecto/ecto/security/advisories/GHSA-r73h-97w8-m54h","tags":["vendor-advisory","related"]},{"url":"https://cna.erlef.org/cves/CVE-2026-32687.html","tags":["related"]},{"url":"https://osv.dev/vulnerability/EEF-CVE-2026-32687","tags":["related"]},{"url":"https://github.com/elixir-ecto/postgrex/commit/7cdedbd4316bb65f82e6a9a4f922c0ac491cb770","tags":["patch"]}],"metrics":[{"cvssV4_0":{"attackComplexity":"LOW","attackRequirements":"PRESENT","attackVector":"LOCAL","baseScore":7.5,"baseSeverity":"HIGH","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:H/VI:H/VA:H/SC:N/SI:N/SA:N","version":"4.0","vulnAvailabilityImpact":"HIGH","vulnConfidentialityImpact":"HIGH","vulnIntegrityImpact":"HIGH"},"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":{"shortName":"EEF","orgId":"6b3ad84c-e1a6-4bf7-a703-f496b71e49db","dateUpdated":"2026-07-24T14:16:18.902Z"},"configurations":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/html","value":"<p>The application must call <tt>'Elixir.Postgrex.Notifications':listen/3</tt> or <tt>'Elixir.Postgrex.Notifications':unlisten/3</tt> with a channel name derived from untrusted user input.</p>"}],"value":"The application must call 'Elixir.Postgrex.Notifications':listen/3 or 'Elixir.Postgrex.Notifications':unlisten/3 with a channel name derived from untrusted user input."}],"cpeApplicability":[{"nodes":[{"cpeMatch":[{"criteria":"cpe:2.3:a:elixir-ecto:postgrex:*:*:*:*:*:*:*:*","versionEndExcluding":"0.22.2","versionStartIncluding":"0.16.0","vulnerable":true}],"negate":false,"operator":"OR"}],"operator":"AND"}],"credits":[{"lang":"en","type":"finder","value":"Peter Ullrich"}],"impacts":[{"capecId":"CAPEC-66","descriptions":[{"lang":"en","value":"CAPEC-66 SQL Injection"}]}],"source":{"discovery":"EXTERNAL"},"x_generator":{"engine":"cvelib 1.8.0"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"timestamp":"2026-05-12T19:44:22.093287Z","id":"CVE-2026-32687","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"total"}],"role":"CISA Coordinator","version":"2.0.3"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2026-05-12T19:44:35.571Z"}}]}}}