Impact
Postgrex allows an attacker who can supply a comment string to craft an invalid comment delimiter and inject arbitrary SQL clauses into the streamed statement. The injected code runs under the connection’s role and can modify data, create or drop tables, or otherwise compromise the database. The vulnerability is a classic SQL Injection flaw (CWE‑89) and is not a full/automatic escalation of permissions; it is limited to the statement being streamed.
Affected Systems
Affected systems include the Elixir‑Ecto Postgrex library in any releases from 0.19.3 up to, but not including, 0.22.4. The same issue is present in Ecto when using Ecto.Repo.stream/2, which forwards the comment option to Postgrex. The CPE string identifies the generic “postgrex” product.
Risk and Exploitability
The CVSS base score of 5.9 indicates a medium severity vulnerability. No EPSS value is available, and the flaw is not listed in the CISA KEV catalog. An attacker needs to influence the :comment option supplied to Postgrex.stream/4 or Ecto.Repo.stream/2, a capability that is typically available to code executing within the application. The attack surface is therefore contingent on the application allowing untrusted input to reach the function.
OpenCVE Enrichment