CVE-2026-66838
published medium CVSS 4.0 · 5.9SQL injection via the :comment option in Postgrex.stream/4
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| elixir-ecto | — | postgrex0.19.3 to < 0.22.4 · Other versions: unaffected | Affected | Not stated | EEF |
| elixir-ecto | — | elixir-ecto/postgrexpostgrex · 4971a2722fa72f8e1b54a2c403cad4c43916e36d and later (affected · git); changes: unaffected at 4011be852c99dc61ddb98cb01aa41e8775a0e3dd, unaffected at e1ecba618ddea4cee2556bd6ad9b6285e05f9d3c · Other versions: unaffected | Version-specific | Not stated | EEF |
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.
Related advisories
Vendor advisories explicitly linked to this CVE.
No linked advisories were found for this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 4.0
- Base score
- 5.9 / 10
- Severity
- medium
- Provider
- EEF · cna
- Vector string
- 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
- Scenarios
- en: GENERAL
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| elixir-ecto | postgrex | 0.19.3 to < 0.22.4 (affected · semver)Default: unaffected | EEF · cna |
| elixir-ecto | postgrex | 4971a2722fa72f8e1b54a2c403cad4c43916e36d and later (affected · git); changes: unaffected at 4011be852c99dc61ddb98cb01aa41e8775a0e3dd, unaffected at e1ecba618ddea4cee2556bd6ad9b6285e05f9d3cDefault: unaffected | EEF · cna |
Weaknesses
1- CWE-89 CWE-89 Improper Neutralization of Special Elements used in an SQL Command
References
6- EEF CNA record for CVE-2026-66838 https://cna.erlef.org/cves/CVE-2026-66838.html
- https://github.com/elixir-ecto/ecto/security/advisories/GHSA-3gww-3f36-2388
- Fix commit 4011be8 in elixir-ecto/postgrex https://github.com/elixir-ecto/postgrex/commit/4011be852c99dc61ddb98cb01aa41e8775a0e3dd
- Introducing commit 4971a27 in elixir-ecto/postgrex https://github.com/elixir-ecto/postgrex/commit/4971a2722fa72f8e1b54a2c403cad4c43916e36d
- Fix commit e1ecba6 in elixir-ecto/postgrex https://github.com/elixir-ecto/postgrex/commit/e1ecba618ddea4cee2556bd6ad9b6285e05f9d3c
- OSV record EEF-CVE-2026-66838 https://osv.dev/vulnerability/EEF-CVE-2026-66838
Provider assertions
2EEF · cna
SQL injection via the :comment option in Postgrex.stream/4
CISA-ADP · adp
CISA ADP Vulnrichment
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- bfaf33a97570baa4ec1b598c513de106dc0e22db5e40ee7f93a66bc6a41864cb
- Ingested
- 20 Nov 2026, 06:18:48 UTC
- Source record
- Official CVE record