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-66838: CWE-89 Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') in elixir-ecto postgrex

0
Medium
VulnerabilityCVE-2026-66838cvecve-2026-66838cwe-89
Published: 08/07/2026 (08/07/2026, 12:20:02 UTC)
Source: CVE Database V5
Vendor/Project: elixir-ecto
Product: postgrex

Description

Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') vulnerability in elixir-ecto postgrex allows SQL Injection via the :comment option of Postgrex.stream/4. An attacker who can influence that value can close the comment delimiter with */ and extend the streamed statement with their own clauses, which execute under the connection's role. Ecto exposes the same option through Ecto.Repo.stream/2. Postgrex appends the comment by concatenating it into the statement text sent in the Parse message, without escaping or rejecting */. The option is validated by comment_not_present!/1 at every other execution point; stream/4 never calls it. Because Parse accepts a single command, the injection is confined to the streamed statement and further statements cannot be chained. This issue affects postgrex: from 0.19.3 before 0.22.4.

CVSS v4.0

Score 5.9medium

Attack Vector
Local
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
None
User Interaction
None
Vuln. Confidentiality
High
Vuln. Integrity
Low
Vuln. Availability
None
Subsq. Confidentiality
None
Subsq. Integrity
None
Subsq. Availability
None
CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N

Affected software

postgrex
pkg:hex/postgrex
Affected versions
>=0.19.3 <0.22.4
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: 08/07/2026, 12:48:00 UTC

Technical Analysis

The vulnerability arises because Postgrex.stream/4 concatenates the :comment option directly into the SQL statement without escaping or rejecting the comment terminator sequence '*/'. This allows an attacker who can influence the :comment value to prematurely close the comment and append additional SQL clauses that execute with the connection's privileges. The validation function comment_not_present!/1 is not called by stream/4, unlike other execution points. The injection is confined to the streamed statement since the Parse message accepts only a single command. The issue affects postgrex versions >=0.19.3 and <0.22.4.

Potential Impact

An attacker able to control the :comment option in Postgrex.stream/4 or Ecto.Repo.stream/2 can perform SQL Injection within the streamed statement. This could lead to unauthorized data access or manipulation under the database connection's role. However, the injection is limited to a single statement and cannot chain multiple SQL commands. The vulnerability requires local access or ability to influence the :comment parameter, limiting remote exploitation potential.

Mitigation Recommendations

Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is available, avoid passing untrusted input to the :comment option in Postgrex.stream/4 and Ecto.Repo.stream/2. Review application code to ensure that the :comment parameter is not influenced by external or untrusted sources.

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-08-06T14:00:01.865Z
Cvss Version
4.0
State
PUBLISHED
Remediation Level
null

Threat ID: 6a75cf11bf8831d5394aa20f

Added to database: 08/07/2026, 12:26:57 UTC

Last enriched: 08/07/2026, 12:48:00 UTC

Last updated: 08/07/2026, 12:56:49 UTC

Views: 9

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