CVE-2026-66838: CWE-89 Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') in elixir-ecto postgrex
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.
AI Analysis
Technical Summary
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.
CVE-2026-66838: CWE-89 Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') in elixir-ecto 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
Affected software
elixir-ecto
postgrex
elixir-ecto
postgrex
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.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
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.
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 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
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
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.