Skip to main content
EPSS 0.3%top 79%

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

CVE-2026-66838 is a medium severity SQL Injection vulnerability in the elixir-ecto postgrex library. It arises from improper neutralization of special elements in the :comment option of Postgrex.stream/4, allowing an attacker who can control this value to inject SQL clauses within the streamed statement. The injection is limited to the streamed statement and cannot chain further commands. This affects postgrex versions from 0.19.3 up to but not including 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

elixir-ecto

postgrex

Affected versions
>=0.19.3 <0.22.4

elixir-ecto

postgrex

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/14/2026, 16:15:23 UTC

Technical Analysis

The vulnerability in elixir-ecto postgrex (CVE-2026-66838) is due to improper neutralization of special elements used in an SQL command, specifically via the :comment option of Postgrex.stream/4. The library appends the comment by concatenating it directly into the SQL statement without escaping or rejecting the sequence '*/'. An attacker able to influence this comment can close the comment delimiter and append additional SQL clauses that execute under the database connection's role. The Ecto.Repo.stream/2 interface exposes the same vulnerable option. The injection is confined to the streamed statement because the Parse message accepts only a single command, preventing statement chaining. This issue affects postgrex versions starting at 0.19.3 and before 0.22.4.

Potential Impact

An attacker with the ability to control the :comment option in Postgrex.stream/4 or Ecto.Repo.stream/2 can inject SQL clauses into the streamed statement. These injected clauses execute with the privileges of the database connection role. However, the injection is limited to the streamed statement and cannot be used to execute multiple chained statements. This could lead to unauthorized data access or modification within the scope of the streamed query.

Mitigation Recommendations

Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. No official fix or patch is indicated in the provided data. Until a patch is available, avoid passing untrusted input to the :comment option in Postgrex.stream/4 or Ecto.Repo.stream/2 to prevent injection. Monitor vendor communications for updates on remediation.

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

Threat ID: 6a75cf11bf8831d5394aa20f

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

Last enriched: 08/14/2026, 16:15:23 UTC

Last updated: 09/22/2026, 01:52:45 UTC

Views: 57

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