CVE-2026-58225: elixir-ecto postgrex · SQL Injection
Affects elixir-ecto postgrexSource CVE Database V5
Not known to be exploited · CVSS 2.1 Low : upgrade to 0.22.3 when convenient.
Data as of 21 Nov 2026, 17:35 UTC
- EPSS
- 0.2% chance of exploitation in 30 days – higher than 18% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
- Patch
- Available – fixed in 0.22.3, 795c6062f62c4394272ff4b89170688857b4f841
CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:NExploitation evidence
Disclosed: evidence found.
CVE published 10 Jul 2026
Detectable: no evidence on record.
No public nuclei template indexed
Weaponized: evidence found.
Public exploit code: GitHub proofs of concept
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by Mirage: no evidence on record.
No attack traffic recorded by OffSeq Mirage sensors
A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), GitHub proofs of concept, the Metasploit, Exploit-DB and nuclei-templates index as of 21 Nov 2026.
What to do
Upgrade postgrex to 0.22.3; postgrex to 795c6062f62c4394272ff4b89170688857b4f841.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| elixir-ectopostgrex | Affected
| Fixed in
|
| elixir-ectopostgrex | Affected
| Fixed in
|
Hexpostgrexpkg:hex/postgrexOther threats | Affected
| Fixed in
|
CPE configurations (1)
cpe:2.3:a:elixir-ecto:postgrex:*:*:*:*:*:*:*:*
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
If you cannot patch yet, avoid passing untrusted input as channel names to Postgrex.Notifications.listen/3, especially input containing the $$ delimiter.
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.
References
- github.com/elixir-ecto/ecto/security/advisories/GHSA-4mw9-4qgj-m97w (opens in a new tab)
- cna.erlef.org/cves/CVE-2026-58225.html (opens in a new tab)
- osv.dev/vulnerability/EEF-CVE-2026-58225 (opens in a new tab)
- github.com/elixir-ecto/postgrex/commit/795c6062f62c4394272ff4b89170688857b4f841 (opens in a new tab)