{"id":"CVE-2026-120821","kind":"vulnerability","aliases":["CVE-2026-120821"],"related":[],"title":"MongoDB Server: aggregation use-after-free lets a reader crash the server","description":"A use-after-free in the aggregation framework of MongoDB Server can occur when certain expressions are evaluated in an aggregation sub-pipeline. The condition can be caused by an authenticated user with read privileges, and may result in the server terminating unexpectedly.","summary":"A use-after-free in MongoDB Server 9.0's aggregation framework: cloned expressions ($sortArray, $topN, $top, $bottom, $bottomN) keep a pointer to a collator that can be freed with the original expression context. An authenticated user with read privileges can make the server terminate. Fixed in 9.0.7.","severity":"high","cvss":7.1,"epss":null,"exploited":false,"exploited_at":null,"products":[{"name":"MongoDB Server","fixed":["9.0.7"],"affected":">= 9.0.0, < 9.0.7","ecosystem":"vendor"}],"ecosystems":["vendor"],"tags":["database","mongodb","mongodb-9.0","package","self-hosted"],"not_affected_if":["mongodb-7.0","mongodb-8.0","no-authenticated-readers"],"how_to_check":"Run mongod --version (or db.version() in mongosh). Exposed if it reports 9.0.0 through 9.0.6. 7.0, 8.0 and 8.3 are not listed: the bug comes from the clone() change in SERVER-119491, added in 9.0. Also check if you run a 9.0 build from a vendor or Atlas-like distribution that you patch yourself.","fix":"Upgrade MongoDB Server 9.0 to 9.0.7 or later (SERVER-136285 Fix Version 9.0.7).","status":"open","published_at":"2026-11-10T21:19:01+00:00","first_seen_at":"2026-11-10T21:46:15+00:00","triaged_at":"2026-11-10T21:48:25+00:00","updated_at":"2026-11-10T21:52:36+00:00","category":"package","confidence":0.75,"triage":{"at":"2026-11-10T21:48:25Z","model":"claude-haiku-5-5","output":{"fix":"unknown","reach":"network","title":"MongoDB Server: aggregation use-after-free lets a reader crash the server","impact":"low","summary":"A memory bug in MongoDB Server's aggregation framework can be triggered when certain expressions run inside an aggregation sub-pipeline. An authenticated user with read privileges can make the server terminate unexpectedly.","audience":"businesses","category":"package","nicknames":[],"who_cares":["mongodb","self-hosted","database"],"confidence":0.6,"fix_status":"unknown","needs_auth":"yes","worst_case":"Server process terminates unexpectedly, causing database downtime","analyst_note":"Confirm affected and fixed MongoDB Server versions from the NVD entry or MongoDB's security advisory; the sources given do not list them.","how_to_check":"- Check the MongoDB Server version with `mongod --version` and compare it against the fixed versions in the sources.\n- unknown for affected version ranges: the sources given do not list them.","plain_action":"","product_name":"MongoDB Server","needs_analyst":true,"not_affected_if":["no-authenticated-readers"],"who_is_affected":"Any deployment running MongoDB Server where users hold read privileges can trigger the crash, since the flaw needs only an authenticated read-level account. Standalone, replica set and sharded deployments that run the aggregation framework are in scope. Servers where no untrusted or low-privilege users can authenticate are at much lower risk.","user_interaction":"no","product_ecosystem":"vendor","needs_special_setup":"no","severity_if_unknown":"unknown"},"cost_usd":0.000734,"input_tokens":4539,"output_tokens":561,"severity_before":"high"},"analyst_status":"done","analyst_note":"Confirm affected and fixed MongoDB Server versions from the NVD entry or MongoDB's security advisory; the sources given do not list them.","search":"'-120821':16A,19A '-2026':15A,18A '-9.0':25B '9.0':38B '9.0.7':77B 'aggreg':3A,40B,85C,99C 'authent':65B,110C 'bottom':47B 'bottomn':48B 'caus':107C 'certain':93C 'clone':42B 'collat':54B 'condit':104C 'context':63B 'crash':11A 'cve':14A,17A 'databas':22B 'evalu':96C 'express':43B,62B,94C 'fix':75B 'framework':41B,86C 'free':7A,34B,82C 'freed':58B 'host':29B 'keep':49B 'let':8A 'make':71B 'may':116C 'mongodb':1A,20A,23B,24B,36B,88C 'occur':91C 'origin':61B 'packag':26B 'pipelin':102C 'pointer':51B 'privileg':69B,114C 'read':68B,113C 'reader':10A 'result':117C 'self':28B 'self-host':27B 'server':2A,13A,21A,37B,73B,89C,120C 'sortarray':44B 'sub':101C 'sub-pipelin':100C 'termin':74B,121C 'top':46B 'topn':45B 'unexpect':122C 'use':5A,32B,80C 'use-after-fre':4A,31B,79C 'user':66B,111C","nicknames":[],"mitigations":[],"who_affected":"Self-run MongoDB Server 9.0.0 to 9.0.6 where untrusted or low-privilege users can authenticate and run aggregations; a read-only account is enough to crash the server. The Jira ticket traces the bug to a change added in 9.0, so earlier lines (7.0, 8.0, 8.3) are not listed as affected; the CVE text itself gives no version list. Skip it if you are not on 9.0 or no untrusted accounts can query.","tier":"B","verified":{"fix":{"at":"2026-11-10T21:52:36Z","by":"analyst","doc":"https://jira.mongodb.org/browse/SERVER-136285","run_id":2872}},"analyst_revisit_at":null,"fix_status":"available","audience":"businesses","plain_action":null,"pkeys":["mongodbserver","server"],"ptokens":["mongodb","server"],"labels":["database","high","mongodb","mongodb90","package","selfhosted","vendor"],"campaign_type":null,"search_a":"'-120821':16A,19A '-2026':15A,18A 'aggreg':3A 'crash':11A 'cve':14A,17A 'free':7A 'let':8A 'mongodb':1A,20A 'reader':10A 'server':2A,13A,21A 'use':5A 'use-after-fre':4A","search_b":"'-9.0':25B '9.0':38B '9.0.7':77B 'aggreg':40B 'authent':65B 'bottom':47B 'bottomn':48B 'clone':42B 'collat':54B 'context':63B 'databas':22B 'express':43B,62B 'fix':75B 'framework':41B 'free':34B 'freed':58B 'host':29B 'keep':49B 'make':71B 'mongodb':23B,24B,36B 'origin':61B 'packag':26B 'pointer':51B 'privileg':69B 'read':68B 'self':28B 'self-host':27B 'server':37B,73B 'sortarray':44B 'termin':74B 'top':46B 'topn':45B 'use':32B 'use-after-fre':31B 'user':66B","search_c":"'aggreg':85C,99C 'authent':110C 'caus':107C 'certain':93C 'condit':104C 'evalu':96C 'express':94C 'framework':86C 'free':82C 'may':116C 'mongodb':88C 'occur':91C 'pipelin':102C 'privileg':114C 'read':113C 'result':117C 'server':89C,120C 'sub':101C 'sub-pipelin':100C 'termin':121C 'unexpect':122C 'use':80C 'use-after-fre':79C 'user':111C","cause_entry":null,"cause_path":null,"disclosures_checked_at":null,"first_public_at":"2026-11-10T21:19:01+00:00","kev":null,"cvss_vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/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":"cna@mongodb.com","poc_count":0,"sources":[{"source":"nvd","external_id":"CVE-2026-120821","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-120821","severity":null,"published_at":"2026-11-10T21:19:01+00:00","modified_at":"2026-11-10T21:19:01+00:00","first_seen_at":"2026-11-10T21:46:15+00:00","fetched_at":"2026-11-10T21:46:15+00:00","note":null},{"source":"analyst","external_id":"CVE-2026-120821:2872","url":"https://jira.mongodb.org/browse/SERVER-136285","severity":null,"published_at":"2026-11-10T21:52:36+00:00","modified_at":"2026-11-10T21:52:36+00:00","first_seen_at":"2026-11-10T21:52:36+00:00","fetched_at":"2026-11-10T21:52:36+00:00","note":"Fix 9.0.7 read on MongoDB Jira SERVER-136285 (maintainer's own); affected range >=9.0.0 <9.0.7 comes from the HOL mapping plus the ticket's note that the bug arose in 9.0, so not verified. NVD page itself returned nothing. No exploitation or PoC seen; did not check social posts (low volume expected).","cites":["https://jira.mongodb.org/browse/SERVER-136285","http://hol.org/guard/security/cves/CVE-2026-120821-post-authentication-use-after-free-in-mongodb"]}],"documents":[{"id":119307,"url":"https://jira.mongodb.org/browse/SERVER-136285","title":"SERVER-136285 Possibly-dangling collator pointer after ExpressionSortArray clone","kind":"advisory","source":"analyst","publisher":null,"text":"Fix Version/s: 9.0.7. Resolved Nov 10 2026. Since SERVER-119491 (added in 9.0), clone() of ExpressionSortArray, ExpressionTopN, ExpressionTop, ExpressionBottom, ExpressionBottomN copies PatternValueCmp _sortBy, which holds a pointer to the Collator of the original ExpressionContext; it dangles when that context is destroyed. Fix: clone PatternValueCmp with the new ExpCtx. Backport requested: v9.0.","published_at":null,"relation":"advisory","confidence":null,"note":null},{"id":119309,"url":"http://hol.org/guard/security/cves/CVE-2026-120821-post-authentication-use-after-free-in-mongodb","title":"HOL Guard: CVE-2026-120821","kind":"other","source":"analyst","publisher":null,"text":"Maps MongoDB Server >=9.0.0 <9.0.7, fixed 9.0.7; cites SERVER-136285. Rewrite of CVE record.","published_at":null,"relation":"mentions","confidence":null,"note":null}],"disclosures":[],"exploit_sources":[],"notice":"Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai"}