{"id":"CVE-2026-118391","title":"Unbounded query cache growth from interpolated JSON paths and splice lists in Ecto","summary":"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 …","severity":"high","cvss":8.9,"cvssVector":"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","cvssSource":"cna","cwe":["CWE-770"],"vendor":"elixir-ecto","product":"ecto","affected":["ecto >= 3.4.0 < 3.14.3","elixir-ecto/ecto >= cb2f03964dac324a9771f84f5088e395326e6de8 < eef014ad090d27d1a5b69c0e32a50eabd44ab3bb"],"ssvc":{"exploitation":"none","automatable":"yes","technicalImpact":"partial","timestamp":"2026-11-04T20:48:32.374051Z"},"published":"2026-11-04","updated":"2026-11-05","sourceUpdated":"2026-11-05T19:07:34.294Z","source":"CVEORG","sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-118391","references":[{"url":"https://github.com/elixir-ecto/ecto/security/advisories/GHSA-cxjx-vmm2-qr8r","label":"GHSA-cxjx-vmm2-qr8r"},{"url":"https://cna.erlef.org/cves/CVE-2026-118391.html","label":"EEF CNA record for CVE-2026-118391"},{"url":"https://osv.dev/vulnerability/EEF-CVE-2026-118391","label":"OSV record EEF-CVE-2026-118391"},{"url":"https://github.com/elixir-ecto/ecto/commit/d0e97d8a6e274c81c25fbf08087da8d8b9bae0ea","label":"Do not cache queries with interpolated JSON paths, splices, and constants (main)"},{"url":"https://ecto.hexdocs.pm/Ecto.Query.API.html#json_extract_path/2","label":"Ecto.Query.API.json_extract_path/2"},{"url":"https://ecto.hexdocs.pm/Ecto.Query.API.html#splice/1","label":"Ecto.Query.API.splice/1"},{"url":"https://github.com/elixir-ecto/ecto/commit/eb03f45b999e2bf67ffae92811233eb6e56dba55","label":"Add splice to fragment (#4228), v3.11.0"},{"url":"https://github.com/elixir-ecto/ecto/issues/4470","label":"Should we allow disabling of Ecto cache on specific queries? (#4470)"},{"url":"https://github.com/elixir-ecto/ecto/issues/1031","label":"String interpolation will grow cached unboundedly (#1031)"},{"url":"https://github.com/elixir-ecto/ecto/commit/cb2f03964dac324a9771f84f5088e395326e6de8","label":"Introducing commit cb2f039 in elixir-ecto/ecto"},{"url":"https://github.com/elixir-ecto/ecto/commit/eef014ad090d27d1a5b69c0e32a50eabd44ab3bb","label":"Fix commit eef014a in elixir-ecto/ecto"}],"tags":["cve.org"],"epss":0.00494,"epssPercentile":0.42666,"ingestedAt":"2026-11-05T22:38:31.508Z","slug":"CVE-2026-118391","body":"## Overview\n\nAllocation 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.\n\nThis issue affects ecto: from 3.4.0 before 3.14.3.\n\n## Affected\n\n- `ecto >= 3.4.0 < 3.14.3`\n- `elixir-ecto/ecto >= cb2f03964dac324a9771f84f5088e395326e6de8 < eef014ad090d27d1a5b69c0e32a50eabd44ab3bb`\n\n## Remediation\n\nUpgrade 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.\n\n### Workarounds\n\nPass 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.","depth":"twilight","depthScore":49,"depthScoreParts":{"impact":49,"likelihood":0.1,"exploitation":0,"ransomware":0},"changes":[]}