SQL injection via the :comment option in Postgrex.stream/4
Key facts
- Attack vector
- Local
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Attack requirements
- Present
- Impact type
- SQL injection
- Confidentiality · integrity · availability
- High · Low · None
- Fix status
- Fixed
Attack profile from CVSS 4.0 · CNA. Fix status from CNA. Impact type from CWE-89.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| elixir-ecto | postgrex | 0.19.3 to before 0.22.4 | 0.22.4 | Patch available | CNA |
- postgrex Vendorelixir-ecto Affected 0.19.3 to before 0.22.4 Fixed in 0.22.4 Patch available CNA
CPE configurations NVD · 1
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:elixir-ecto:postgrex:*:*:*:*:*:*:*:* | 0.19.3 to before 0.22.4 | Vulnerable | elixir-ecto |
- cpe:2.3:a:elixir-ecto:postgrex:*:*:*:*:*:*:*:* Versions 0.19.3 to before 0.22.4 Vulnerable ·elixir-ecto
Remediation
- Fix · CNA postgrex (elixir-ecto) Fixed in 0.22.4
Timeline
- 2026-10-02 Threatist record created from CVE-2026-66838
References
More elixir-ecto Postgrex vulnerabilities
- TI-2026-25179 SQL injection via channel name in Postgrex.Notifications.listen/3 and unlisten/3 CVSS 4.0HIGH 7.5
Sources
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences