SEVERITY NOT PROVIDED · CVSS 4.0 EPSS 0.5% · 33th percentile CWE-470

CVE-2026-133555: Code execution via the :log option of forged DBConnection.Stream structs in db_connection

Published 2026-11-24 · Updated 2026-11-25 · Also known as EEF-CVE-2026-133555, GHSA-gmmq-fw75-wq46

Summary

The db_connection library contains an unsafe reflection vulnerability where forged structs can trigger arbitrary code execution during enumeration. Developers using Elixir applications that deserialize untrusted data into structs should upgrade their dependencies immediately.

Who is affected

This vulnerability affects Elixir applications that utilize db_connection versions 1.1.0 through 2.10.2. Exploitation requires an application to deserialize untrusted binary data into structs-typically using unsafe methods like :erlang.binary_to_term/2-and subsequently enumerate those structures.

Exploitability

The vulnerability requires local access and specific preconditions, as reflected by the CVSS 4.0 vector indicating Low attack complexity and Privileged access requirements. The low EPSS score of 0.005 suggests a limited probability of exploitation in the wild, and it is not currently listed as a CISA Known Exploited Vulnerability.

Remediation

How to check your project

Automated analysis of the published advisory data, generated 2026-11-26. Not human-reviewed; verify against the official advisory. How this works.

Affected packages

EcosystemPackageAffected versionsFixed inUpgrade
Hex db_connection >= 1.1.0, < 2.10.3 2.10.3 mix deps.update db_connection

CVSS 4.0 vector

CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H

Attack vectorLocal
Attack complexityLow
Attack requirementsPresent
Privileges requiredNone
User interactionNone
Confidentiality (vulnerable system)High
Integrity (vulnerable system)High
Availability (vulnerable system)High
Confidentiality (subsequent systems)High
Integrity (subsequent systems)High
Availability (subsequent systems)High

Base score is not computed for CVSS 4.0 vectors; severity is taken from the advisory.

FAQ

Is db_connection itself the direct cause of this vulnerability?

No, the vulnerability is triggered by downstream components that unsafely deserialize untrusted input into db_connection structs, which then execute logic during enumeration.

Does using the :safe option in binary_to_term prevent this attack?

No, the :safe option in :erlang.binary_to_term does not reject structs, meaning it does not mitigate this specific vulnerability.

What is the primary risk associated with this flaw?

An attacker capable of crafting a malicious struct can achieve remote code execution by triggering the evaluation of an exported function within the application's VM.

Original advisory description
## Summary 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. ## Impact An attacker who can make an application build and enumerate a forged stream struct can call an exported function of a loaded module with chosen arguments in the application's VM. ## Configurations The application, or one of its dependencies, builds Elixir structs from untrusted input (for example with `:erlang.binary_to_term/2` or `Plug.Crypto.non_executable_binary_to_term/2`) and then enumerates or inspects the result.

References

Source records: EEF-CVE-2026-133555 (OSV.dev) · EPSS by FIRST, 2026-11-26.