CVE-2026-66838: SQL injection via the :comment option in Postgrex.stream/4

Published Aug 7, 2026
·
Updated

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 commentnotpresent!/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 Software

1 affected component
elixir-ecto Postgrex>0.19.3<=0.22.4

Event History

Aug 7, 2026
CVE Published
via MITRE·12:20 PM
Data Sourced
via MITRE·12:20 PM
DescriptionWeakness
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-66838?

CVE-2026-66838 has a risk rating of 56, indicating a moderate severity level.

2

How do I fix CVE-2026-66838?

To fix CVE-2026-66838, ensure that input passed to the :comment option in Postgrex.stream/4 is properly sanitized to prevent SQL injection.

3

What products are affected by CVE-2026-66838?

CVE-2026-66838 affects the elixir-ecto Postgrex library used in Elixir applications.

4

What type of vulnerability is CVE-2026-66838?

CVE-2026-66838 is classified as an SQL Injection vulnerability.

5

Can an attacker exploit CVE-2026-66838 remotely?

Yes, an attacker can exploit CVE-2026-66838 remotely if they can influence the value passed to the :comment option.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203
CVE-2026-66838 - SQL injection via the :comment option in Postgrex.stream/4 - SecAlerts