CVE-2026-118391 PUBLISHED

Unbounded query cache growth from interpolated JSON paths and splice lists in Ecto

Assigner: EEF
Reserved: 30.10.2026 Published: 04.11.2026 Updated: 04.11.2026

Allocation of Resources Without Limits or Throttling vulnerability in elixir-ecto ecto allows an unauthenticated remote attacker to exhaust memory in the application and in the database server by sending requests with distinct JSON keys or list lengths where the application interpolates them into json_extract_path/2, field[^key] or splice/1. Ecto caches prepared queries per repository in an ETS table with no size limit and no eviction. Interpolated JSON path elements become part of the query expression instead of its parameters, and splice/1 expands into one placeholder per element, so every distinct key or list length creates a new cache entry. With ecto_sql each entry is also a new prepared statement on the database connection that runs it. None of this memory is released until the processes restart.

This issue affects ecto: from 3.4.0 before 3.14.3.

Metrics

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

Product Status

Vendor elixir-ecto
Product ecto
Versions Default: unaffected
  • affected from 3.4.0 to 3.14.3 (excl.)
Vendor elixir-ecto
Product ecto
Versions Default: unaffected
  • affected from cb2f03964dac324a9771f84f5088e395326e6de8 to eef014ad090d27d1a5b69c0e32a50eabd44ab3bb (excl.)

Affected Configurations

The application must pass request data into an interpolated JSON path (json_extract_path(field, ^path), json_extract_path(field, [^key]) or field[^key]), or a request-controlled list into splice/1, and run the query through a repository with the default query_cache: true.

Workarounds

Pass the path as a query parameter so it is not part of the cache key. With PostgreSQL: fragment("? #> ?", i.meta, type(^path, {:array, :string})). Alternatively, disable the cache for these queries with Repo.all(query, query_cache: false), or restrict keys and list lengths to a known set before building the query.

Solutions

Upgrade Ecto to 3.14.3 or later. Queries with interpolated JSON path elements or an interpolated splice/1 list are no longer cached, the same as running them with query_cache: false, so distinct keys and list lengths don't add cache entries.

Credits

  • Eric Meadows-Jönsson finder
  • Eric Meadows-Jönsson reporter
  • José Valim remediation developer

References

Problem Types

  • CWE-770 Allocation of Resources Without Limits or Throttling CWE

Impacts

  • An unauthenticated client can make the application and its database keep memory from every request that carries a new JSON key or list length, when the application passes it into an interpolated JSON path or splice/1. Nothing frees that memory until the processes restart. In the proof of concept, 200 requests with 100 MB of keys in total left 191 MB in the BEAM and 289 MB in the PostgreSQL backend of one connection. Sustained requests exhaust memory in the application node, the database server, or both.