Forged DBConnection.Stream structs run code in db_connection
Key facts
- Attack vector
- Local
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Attack requirements
- Present
- Impact type
- —
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Fixed
Attack profile from CVSS 4.0 · CNA. Fix status from CNA.
Summary
Versions of db_connection from 1.1.0 before 2.10.3 are affected by CWE-470, unsafe selection of code from externally controlled input. The Enumerable implementations of DBConnection.Stream and DBConnection.PrepareStream run the options stored in the struct, and the :log option accepts a module, function and arguments tuple that DBConnection calls when the struct is enumerated. The source says the flaw is not exploitable in db_connection alone and depends on a downstream component that decodes untrusted input with :erlang.binary_to_term/2 without restricting the resulting terms, so an attacker can execute arbitrary code through such a component by supplying a forged struct.
Written with Claude Haiku 5.5 from the sources below · 2026-11-24
Description from the CNA
Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection') vulnerability in elixir-ecto db_connection allows an attacker to execute arbitrary code via a forged DBConnection.Stream or DBConnection.PrepareStream struct. The Enumerable implementations of both structs in lib/db_connection.ex run with the options stored in the struct. The :log option accepts a {module, function, arguments} tuple, which DBConnection applies. When code enumerates a forged struct, DBConnection calls the chosen function. This issue is not exploitable in db_connection alone. It is, in theory, a vulnerability of the downstream component. The root cause is a component that decodes untrusted input with :erlang.binary_to_term/2 and does not restrict which terms the result contains. The :safe option does not reject structs, and these structs contain only plain terms. Structs of other libraries can possibly lead to the same result, so a component that decodes untrusted terms stays at risk independently of db_connection. This record exists because the struct was used in attacks on such components. This issue affects db_connection: from 1.1.0 before 2.10.3.
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| elixir-ecto | db_connection | 1.1.0 to before 2.10.3 | 2.10.3 | Patch available | CNA |
- db_connection Vendorelixir-ecto Affected 1.1.0 to before 2.10.3 Fixed in 2.10.3 Patch available CNA
CPE names CNA · 1
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:elixir-ecto:db_connection:*:*:*:*:*:*:*:* | — | — | elixir-ecto |
- cpe:2.3:a:elixir-ecto:db_connection:*:*:*:*:*:*:*:* Versions — — ·elixir-ecto
Remediation
Upgrade db_connection to version 2.10.3 or later.
Written with Claude Haiku 5.5 from the sources below · 2026-11-24
- Fix · CNA db_connection (elixir-ecto) Fixed in 2.10.3
Timeline
- 2026-11-24 Threatist record created from CVE-2026-133555
- 2026-11-24 1 new reference · CNA
References
Other 6
- EEF CNA record for CVE-2026-133555
- OSV record EEF-CVE-2026-133555
- CVE-2026-124283: Code execution and SQL injection via struct-wrapped values in a forged keyset pagination cursor in Ash
- CVE-2026-129514: Unauthenticated remote code execution through struct values in Erlang term request bodies
- CVE-2026-130411: Code execution through deserialization of pagination cursors in flop
- Introducing commit 7b21e04 in elixir-ecto/db_connection
More elixir-ecto vulnerabilities
- TI-2026-47460 SQL injection via the :comment option in Postgrex.stream/4 CVSS 4.0MEDIUM 5.9
- TI-2026-85063 Unbounded query cache growth from interpolated JSON paths and splice lists in Ecto CVSS 4.0HIGH 8.9
- TI-2026-41928 SQL injection in elixir-ecto postgrex CVSS 4.0LOW 2.1
- 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