{"answers":{"affected":"1 open source package ship an affected version, including postgrex.","exploited":"It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-58225 exists.","fix":"Upgrade postgrex to 0.22.3 or later.","what":"CVE-2026-58225 is a low-severity SQL injection vulnerability in elixir-ecto postgrex, published on 10 Jul 2026. It can only be exploited from the same machine or local network, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2026-58225 and fix it if it is affected.\n\nWhat it is: CVE-2026-58225 is a low-severity SQL injection vulnerability in elixir-ecto postgrex, published on 10 Jul 2026. It can only be exploited from the same machine or local network, with no action from the victim.\nExploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-58225 exists.\n\nAffected packages and fixed versions:\n- postgrex (Hex): affected from 0.16.0; fixed in 0.22.3\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2026-58225/ (Markdown: https://insights.sbomify.com/CVE-2026-58225/index.md)","id":"CVE-2026-58225","markdown":"https://insights.sbomify.com/CVE-2026-58225/index.md","name":"CVE-2026-58225","record":{"aliases":["EEF-CVE-2026-58225","GHSA-4mw9-4qgj-m97w"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["denial_of_service"],"network_reachable":"adjacent_or_local","non_default_config":false,"product_category":"Elixir Postgrex library","requires_auth":"none","summary":"Attackers can cause denial of service in Postgrex notification connections by injecting dollar-quote delimiters into channel names, breaking reconnection logic.","user_interaction":"not_required","vuln_class":"sql_injection"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"EEF","cpe":[],"cvss":{"score":2.1,"severity":"low","source":"cna","vector":"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"},"cwes":[{"id":"CWE-89","name":"Improper Neutralization of Special Elements used in an SQL Command"}],"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.\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.","ecosystems":["Hex"],"exploits":{"exploitdb":0,"first_seen":"2026-09-28","github_poc":1,"max_poc_stars":0,"metasploit":0,"nuclei":0,"refs":[{"date":"2026-09-28T16:18:17Z","kind":"github_poc","ref":"https://github.com/sifatnotes/Learn-SecByte-CMS-CVE-Shell-to-Root-Privilege-Escalation-CTF-Labs","stars":0,"title":"Hands-on cybersecurity and CTF labs covering port reconnaissance, CMS stack discovery, VulnCMS, CVE-2026-58225, shell-to-root paths, Python, sudo, user switching, passwords, and post-exploitation."}],"tier":"weaponised"},"has_fix":true,"headline":"SQL injection in postgrex","id":"CVE-2026-58225","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"Hex","product":null,"products":[],"type":"sql_injection","year":"2026"},"n_packages":1,"n_references":4,"next":{"headline":"Unauthenticated denial-of-service via unbounded HPACK integer decoding in hpax","id":"CVE-2026-58226"},"packages":[{"ecosystem":"Hex","fixed":["0.22.3"],"introduced":["0.16.0"],"last_affected":[],"package":"postgrex","purl":"pkg:hex/postgrex","source":"EEF-CVE-2026-58225"}],"prev":{"headline":"Samba: ctdb fails to do integrity checking of received packets","id":"CVE-2026-58224"},"products":["postgrex"],"published":"2026-07-10","related":[],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"Erlang Ecosystem Foundation","prefix":"EEF"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"},{"class":"open","licence":"CC0","name":"PoC-in-GitHub"}],"ssvc":{"automatable":"no","exploitation":"poc","technical_impact":"partial"},"state":"PUBLISHED","updated":"2026-07-10","vendors":["elixir-ecto"]},"summary":"Attackers can cause denial of service in Postgrex notification connections by injecting dollar-quote delimiters into channel names, breaking reconnection logic.","url":"https://insights.sbomify.com/CVE-2026-58225/"}