Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2026-58225: CWE-89 Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') in elixir-ecto postgrex

0
Low
VulnerabilityCVE-2026-58225cvecve-2026-58225cwe-89
Published: 07/10/2026 (07/10/2026, 10:51:46 UTC)
Source: CVE Database V5
Vendor/Project: elixir-ecto
Product: postgrex

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.

CVSS v4.0

Score 2.1low

Attack Vector
Local
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
None
User Interaction
None
Vuln. Confidentiality
None
Vuln. Integrity
None
Vuln. Availability
Low
Subsq. Confidentiality
None
Subsq. Integrity
None
Subsq. Availability
None
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

Affected software

postgrex
pkg:hex/postgrex
Affected versions
>=0.16.0 <0.22.3
GitHub Actionsmore threats →cve
elixir-ecto/postgrex
pkg:github/elixir-ecto/postgrex
CPE configurations
cpe:2.3:a:elixir-ecto:postgrex:*:*:*:*:*:*:*:*

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 07/10/2026, 11:32:29 UTC

Technical Analysis

The vulnerability in elixir-ecto postgrex involves improper neutralization of special elements used in SQL commands (CWE-89). Specifically, the quote_channel/1 function doubles double quotes to sanitize channel names for single-statement LISTEN and UNLISTEN commands, but it does not escape the $$ dollar-quote delimiter used in the reconnect replay query wrapped in a dollar-quoted anonymous code block. An attacker controlling a channel name containing $$ can prematurely terminate the dollar-quoted block, causing PostgreSQL to parse the remainder as additional top-level statements. This malformed query is rejected on every reconnect, preventing notification subscriptions from being re-established and causing a denial of service. The vulnerability affects postgrex versions from 0.16.0 before 0.22.3.

Potential Impact

The impact is a denial of service on the notification connection for all tenants sharing the connection. The malformed reconnect replay query caused by injection of $$ in channel names prevents the notification connection from re-subscribing to channels, silently dropping notifications. Arbitrary SQL execution is not possible due to partial sanitization of channel names.

Mitigation Recommendations

Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until a fix is available, avoid passing untrusted input as channel names to Postgrex.Notifications.listen/3, especially input containing the $$ delimiter. Monitor vendor channels for updates and apply official patches once released.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Data Version
5.2
Assigner Short Name
EEF
Date Reserved
2026-06-29T18:54:08.633Z
Cvss Version
4.0
State
PUBLISHED
Remediation Level
null

Threat ID: 6a50d4f468715ace437a1833

Added to database: 07/10/2026, 11:18:12 UTC

Last enriched: 07/10/2026, 11:32:29 UTC

Last updated: 07/10/2026, 12:18:18 UTC

Views: 5

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses