{"answers":{"affected":"7 open source packages ship an affected version, including mongoose. It affects 1 product.","exploited":"It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-23061 exists.","fix":"Upgrade mongoose to a fixed version for your release line: 6.13.6, 7.8.4 or 8.9.5.","what":"CVE-2025-23061 is a critical code injection vulnerability in mongoosejs Mongoose, published on 15 Jan 2025. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2025-23061 and fix it if it is affected.\n\nWhat it is: CVE-2025-23061 is a critical code injection vulnerability in mongoosejs Mongoose, published on 15 Jan 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-23061 exists.\n\nAffected packages and fixed versions:\n- mongoose (Bitnami): affected from 6.0.0; fixed in 6.13.6, 7.8.4, 8.9.5\n- mongoose (npm): affected all versions; fixed in 6.13.6\n- mongoose (npm): affected all versions; fixed in 6.13.6\n- mongoose (npm): affected from 7.0.0-rc0; fixed in 7.8.4\n- mongoose (npm): affected from 7.0.0-rc0; fixed in 7.8.4\n- mongoose (npm): affected from 8.0.0-rc0; fixed in 8.9.5\n- mongoose (npm): affected from 8.0.0-rc0; fixed in 8.9.5\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2025-23061/ (Markdown: https://insights.sbomify.com/CVE-2025-23061/index.md)","id":"CVE-2025-23061","markdown":"https://insights.sbomify.com/CVE-2025-23061/index.md","name":"CVE-2025-23061","record":{"aliases":["BIT-mongoose-2025-23061","CLSA-2026-1774916722","CLSA-2026-1777250310","GHSA-vg7j-7cwx-8wgw","ROOT-APP-NPM-CVE-2025-23061"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["code_execution"],"network_reachable":"yes","non_default_config":false,"product_category":"Mongoose ODM library","requires_auth":"none","summary":"Attackers can execute arbitrary code via search injection in Mongoose ODM using nested $where filters with populate().","user_interaction":"not_required","vuln_class":"code_injection"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"mitre","cpe":[{"product":"mongoose","vendor":"mongoosejs"}],"cvss":{"score":9,"severity":"critical","source":"cna","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H","version":"3.1"},"cwes":[{"id":"CWE-94","name":"Improper Control of Generation of Code"}],"description":"Mongoose before 8.9.5 can improperly use a nested $where filter with a populate() match, leading to search injection. NOTE: this issue exists because of an incomplete fix for CVE-2024-53900.","ecosystems":["Bitnami","npm"],"exploits":{"exploitdb":0,"first_seen":"2025-12-11","github_poc":2,"max_poc_stars":0,"metasploit":0,"nuclei":1,"refs":[{"date":"2025-12-11T07:50:19Z","kind":"github_poc","ref":"https://github.com/open-flaw/CVE-2025-23061","stars":0,"title":"CVE-2025-23061 - Mongoose Command Injection"},{"date":"2026-04-06T08:43:08Z","kind":"github_poc","ref":"https://github.com/amikanev/CVE-2025-23061-LAB","stars":0,"title":null},{"date":null,"kind":"nuclei","ref":"http/cves/2025/CVE-2025-23061.yaml","stars":null,"title":"Mongoose - NoSQL Injection"}],"tier":"weaponised"},"has_fix":true,"headline":"Mongoose search injection vulnerability","id":"CVE-2025-23061","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"Bitnami","product":null,"products":[],"type":"code_injection","year":"2025"},"n_packages":7,"n_references":4,"next":{"headline":"XSS in Special:RefreshSpecial","id":"CVE-2025-23072"},"packages":[{"ecosystem":"Bitnami","fixed":["6.13.6","7.8.4","8.9.5"],"introduced":["6.0.0","7.0.0","8.0.0"],"last_affected":[],"package":"mongoose","purl":"pkg:bitnami/mongoose","source":"BIT-mongoose-2025-23061"},{"ecosystem":"npm","fixed":["6.13.6"],"introduced":["0"],"last_affected":[],"package":"mongoose","purl":null,"source":"GHSA-vg7j-7cwx-8wgw"},{"ecosystem":"npm","fixed":["6.13.6"],"introduced":["0"],"last_affected":[],"package":"mongoose","purl":"pkg:npm/mongoose","source":"GHSA-vg7j-7cwx-8wgw"},{"ecosystem":"npm","fixed":["7.8.4"],"introduced":["7.0.0-rc0"],"last_affected":[],"package":"mongoose","purl":null,"source":"GHSA-vg7j-7cwx-8wgw"},{"ecosystem":"npm","fixed":["7.8.4"],"introduced":["7.0.0-rc0"],"last_affected":[],"package":"mongoose","purl":"pkg:npm/mongoose","source":"GHSA-vg7j-7cwx-8wgw"},{"ecosystem":"npm","fixed":["8.9.5"],"introduced":["8.0.0-rc0"],"last_affected":[],"package":"mongoose","purl":null,"source":"GHSA-vg7j-7cwx-8wgw"},{"ecosystem":"npm","fixed":["8.9.5"],"introduced":["8.0.0-rc0"],"last_affected":[],"package":"mongoose","purl":"pkg:npm/mongoose","source":"GHSA-vg7j-7cwx-8wgw"}],"prev":{"headline":"Sensitive Data Exposure Vulnerability in HPE Aruba Networking ClearPass Policy Manager (CPPM)","id":"CVE-2025-23060"},"products":["Mongoose"],"published":"2025-01-15","related":[{"cvss_score":10,"headline":"Prototype Pollution in automattic/mongoose","id":"CVE-2023-3696","kev_date_added":null,"published":"2023-07-17"},{"cvss_score":9.1,"headline":"Mongoose search injection vulnerability","id":"CVE-2024-53900","kev_date_added":null,"published":"2024-12-02"},{"cvss_score":9.1,"headline":"Improper Input Validation in Automattic Mongoose","id":"CVE-2019-17426","kev_date_added":null,"published":"2019-10-10"},{"cvss_score":7.5,"headline":"Mongoose: Improper Sanitization of $nor in sanitizeFilter May Allow NoSQL Injection","id":"CVE-2026-42334","kev_date_added":null,"published":"2026-05-14"},{"cvss_score":7,"headline":"Prototype Pollution in automattic/mongoose","id":"CVE-2022-2564","kev_date_added":null,"published":"2022-07-28"}],"sources":[{"class":"attribution","licence":"Apache-2.0","name":"Bitnami","prefix":"BIT"},{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"},{"class":"attribution","licence":"MIT","name":"Nuclei templates"},{"class":"open","licence":"CC0","name":"PoC-in-GitHub"}],"ssvc":{"automatable":"no","exploitation":"none","technical_impact":"total"},"state":"PUBLISHED","updated":"2025-01-15","vendors":["mongoosejs"]},"summary":"Attackers can execute arbitrary code via search injection in Mongoose ODM using nested $where filters with populate().","url":"https://insights.sbomify.com/CVE-2025-23061/"}