CVE-2026-66838

SQL injection via the :comment option in Postgrex.stream/4

HIGH
8.2
CVSS Score
Published: August 7, 2026 at 12:20 PM UTC
Updated: October 24, 2026 at 04:10 PM UTC
2 products affected across 1 vendorPostgrexEcto Postgrex

Using postgrex by elixir-ecto?

Get instant alerts when new vulnerabilities affect postgrex - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
HIGH8.2
Exploit prediction
EPSS 0.4%
SSVC
PoC

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.

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

All versions0.19.34971a2722fa72f8e1b54a2c403cad4c43916e36d
Affected range stops below 0.22.4, so it looks safe — our inference, not a vendor statement
0.19.3 ≤ v < 0.22.40.19.34971a2722fa72f8e1b54a2c403cad4c43916e36d
Affected range stops below 0.22.4, so it looks safe — our inference, not a vendor statement

SSVC — Action Prioritization

SSVCPoCNot automatablePartial impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

Attack Vector
NETWORK
Complexity
LOW
Privileges
NONE
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
HIGH
Integrity
LOW
Availability
NONE
Vector?

Quick Info

StatusANALYZED
CWE
CWE-89

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card