{"id":"CVE-2026-118391","kind":"vulnerability","aliases":["CVE-2026-118391"],"related":[],"title":"Ecto: unbounded query cache lets remote requests exhaust memory","description":"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.\n\nThis issue affects ecto: from 3.4.0 before 3.14.3.","summary":"Ecto caches prepared queries in an unbounded ETS table, and interpolated JSON keys or list lengths from request input create a new cache entry each time. An unauthenticated remote attacker can exhaust memory in the application and on the database server until processes restart.","severity":"high","cvss":8.9,"epss":null,"exploited":false,"exploited_at":null,"products":[],"ecosystems":[],"tags":["ecto","elixir","mysql","package","phoenix","postgres"],"not_affected_if":["ecto-before-3.4.0","no-request-controlled-json-keys","static-query-shapes"],"how_to_check":"- Check the Ecto version in the lockfile, for example `grep ecto mix.lock` in the Elixir project.\n- Look for application code that interpolates request-supplied values into `json_extract_path/2`, `field[^key]` or `splice/1`.\n- Check whether the app uses ecto_sql, since each cache entry also becomes a prepared statement on the database connection.","fix":"- ecto: upgrade to `3.14.3` or later (affected range from 3.4.0 before 3.14.3)","status":"open","published_at":"2026-11-04T14:17:29+00:00","first_seen_at":"2026-11-04T14:27:09+00:00","triaged_at":"2026-11-04T14:28:19+00:00","updated_at":"2026-11-04T14:28:19+00:00","category":"package","confidence":0.7,"triage":{"at":"2026-11-04T14:28:19Z","model":"claude-haiku-5-5","output":{"fix":"- ecto: upgrade to `3.14.3` or later (affected range from 3.4.0 before 3.14.3)","reach":"internet","title":"Ecto: unbounded query cache lets remote requests exhaust memory","impact":"high","summary":"Ecto caches prepared queries in an unbounded ETS table, and interpolated JSON keys or list lengths from request input create a new cache entry each time. An unauthenticated remote attacker can exhaust memory in the application and on the database server until processes restart.","audience":"developers","category":"package","nicknames":[],"who_cares":["elixir","ecto","phoenix","postgres","mysql"],"confidence":0.7,"fix_status":"available","needs_auth":"no","worst_case":"Remote requests exhaust memory in the app and database server","analyst_note":"","how_to_check":"- Check the Ecto version in the lockfile, for example `grep ecto mix.lock` in the Elixir project.\n- Look for application code that interpolates request-supplied values into `json_extract_path/2`, `field[^key]` or `splice/1`.\n- Check whether the app uses ecto_sql, since each cache entry also becomes a prepared statement on the database connection.","plain_action":"","needs_analyst":false,"not_affected_if":["ecto-before-3.4.0","static-query-shapes","no-request-controlled-json-keys"],"who_is_affected":"Applications built on Ecto from 3.4.0 before 3.14.3 that pass request-controlled JSON keys or list lengths into json_extract_path/2, field[^key] or splice/1 are exposed. Apps that only use fixed keys and fixed list shapes in queries are not affected by the request-driven growth. The sources do not say whether ecto_sql adds further exposure beyond the statement cache.","user_interaction":"no","needs_special_setup":"yes","severity_if_unknown":"high"},"cost_usd":0.000763,"input_tokens":4370,"output_tokens":651,"severity_before":"high"},"analyst_status":null,"analyst_note":null,"search":"'-118391':12A,15A '-2026':11A,14A '3.14.3':204C '3.4.0':202C 'affect':199C 'alloc':66C 'allow':79C 'also':175C 'applic':57B,89C,107C 'attack':51B,83C 'becom':139C 'cach':4A,23B,44B,119C,167C 'connect':183C 'creat':41B,164C 'cve':10A,13A 'databas':61B,93C,182C 'distinct':99C,159C 'ecto':1A,16B,22B,77C,78C,118C,170C,200C 'element':138C,156C 'elixir':17B,76C 'elixir-ecto':75C 'entri':45B,168C,173C 'et':29B,126C 'everi':158C 'evict':134C 'exhaust':8A,53B,85C 'expand':151C 'express':144C 'extract':112C 'field':114C 'input':40B 'instead':145C 'interpol':32B,108C,135C 'issu':198C 'json':33B,100C,111C,136C 'key':34B,101C,115C,160C 'length':37B,104C,163C 'let':5A 'limit':70C,131C 'list':36B,103C,162C 'memori':9A,54B,86C,190C 'mysql':18B 'new':43B,166C,177C 'none':187C 'one':153C 'packag':19B 'paramet':148C 'part':140C 'path':137C 'path/2':113C 'per':122C,155C 'phoenix':20B 'placehold':154C 'postgr':21B 'prepar':24B,120C,178C 'process':64B,195C 'queri':3A,25B,121C,143C 'releas':192C 'remot':6A,50B,82C 'repositori':123C 'request':7A,39B,97C 'resourc':68C 'restart':65B,196C 'run':185C 'send':96C 'server':62B,94C 'size':130C 'splice/1':117C,150C 'sql':171C 'statement':179C 'tabl':30B,127C 'throttl':72C 'time':47B 'unauthent':49B,81C 'unbound':2A,28B 'vulner':73C 'without':69C","nicknames":[],"mitigations":[],"who_affected":"Applications built on Ecto from 3.4.0 before 3.14.3 that pass request-controlled JSON keys or list lengths into json_extract_path/2, field[^key] or splice/1 are exposed. Apps that only use fixed keys and fixed list shapes in queries are not affected by the request-driven growth. The sources do not say whether ecto_sql adds further exposure beyond the statement cache.","tier":"B","verified":{},"analyst_revisit_at":null,"fix_status":"available","audience":"developers","plain_action":null,"pkeys":[],"ptokens":[],"labels":["ecto","elixir","high","mysql","package","phoenix","postgres"],"campaign_type":null,"first_public_at":"2026-11-04T08:46:53+00:00","kev":null,"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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","cvss_by":"6b3ad84c-e1a6-4bf7-a703-f496b71e49db","poc_count":0,"sources":[{"source":"nvd","external_id":"CVE-2026-118391","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-118391","severity":null,"published_at":"2026-11-04T14:17:29+00:00","modified_at":"2026-11-04T14:17:29+00:00","first_seen_at":"2026-11-04T14:27:09+00:00","fetched_at":"2026-11-04T14:27:09+00:00","note":null}],"documents":[{"id":67445,"url":"https://github.com/elixir-ecto/ecto/commit/cb2f03964dac324a9771f84f5088e395326e6de8","title":"Patch: github.com","kind":"other","source":"nvd","publisher":"vendor","text":null,"published_at":null,"relation":"fix","confidence":null,"note":"Patch: github.com"},{"id":67446,"url":"https://github.com/elixir-ecto/ecto/commit/d0e97d8a6e274c81c25fbf08087da8d8b9bae0ea","title":"Patch: github.com","kind":"other","source":"nvd","publisher":"vendor","text":null,"published_at":null,"relation":"fix","confidence":null,"note":"Patch: github.com"},{"id":67447,"url":"https://github.com/elixir-ecto/ecto/commit/eb03f45b999e2bf67ffae92811233eb6e56dba55","title":"Patch: github.com","kind":"other","source":"nvd","publisher":"vendor","text":null,"published_at":null,"relation":"fix","confidence":null,"note":"Patch: github.com"},{"id":67448,"url":"https://github.com/elixir-ecto/ecto/commit/eef014ad090d27d1a5b69c0e32a50eabd44ab3bb","title":"Patch: github.com","kind":"other","source":"nvd","publisher":"vendor","text":null,"published_at":null,"relation":"fix","confidence":null,"note":"Patch: github.com"},{"id":67449,"url":"https://github.com/elixir-ecto/ecto/security/advisories/GHSA-cxjx-vmm2-qr8r","title":"Vendor advisory: github.com","kind":"vendor","source":"nvd","publisher":"vendor","text":null,"published_at":"2026-11-04T08:46:53+00:00","relation":"advisory","confidence":null,"note":"Vendor advisory: github.com"}],"notice":"Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai"}