# CVE-2025-1756: MongoDB mongosh local privilege escalation

Source: https://junglewise.ai/threats/cve-2025-1756-mongodb-mongosh-local-privilege-escalation  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2025-02-27. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

CVE-2025-1756 · Severity: low · CVSS 3.1 · Published 2025-02-27

mongosh is a command-line shell for interacting with MongoDB databases. This vulnerability allows a local attacker with user-level access to escalate their privileges to administrator or system level by placing a crafted file in the C:\node_modules directory. A successful exploit could give an attacker control over the entire system when mongosh is run with elevated privileges.

Technologies: [mongosh (npm)](https://junglewise.ai/threats/technologies/mongosh). Vendors: [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

**Is CVE-2025-1756 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2025-1756 being exploited in the wild.

**How severe is CVE-2025-1756?** Low severity, with a CVSS score of 3.1, published 27 February 2025.

**Which products and versions are affected?** mongosh (npm) SEMVER:introduced=0,fixed=2.3.0.

**Is there a fix for CVE-2025-1756?** Yes. mongosh (npm): upgrade to 2.3.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2025-1756 attacked?** It is attacked with local access, in a software library.

**Am I affected by CVE-2025-1756?** Check whether you run mongosh (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- mongosh (npm): upgrade to 2.3.0 or later

  ```sh
  npm install mongosh@2.3.0
  ```


## Technical details

This is an untrusted search path vulnerability (CWE-426) in mongosh versions prior to 2.3.0. The vulnerability occurs on Windows systems where mongosh loads modules from C:\node_modules without proper validation of file integrity or origin. An attacker with local file system access can plant a malicious module in this shared directory; when mongosh executes with elevated privileges (e.g., through a scheduled task or sudo on Windows equivalents), the malicious code runs with those elevated privileges. The attack requires user interaction or administrative action to trigger mongosh execution. The fix is available in mongosh 2.3.0 and later.

## Affected products

- MongoDB mongosh prior to 2.3.0

## Identifiers

- CVE-2025-1756
- GHSA-f5w3-73h4-jpcm

## Timeline

- 2025-02-27: disclosed
- 2025-02-27: patched: Version 2.3.0 fixes the vulnerability

## References

- [https://access.redhat.com/errata/RHSA-2025:1756](https://access.redhat.com/errata/RHSA-2025:1756)

## Related threats

- [MongoDB mongosh control character injection in autocomplete](https://junglewise.ai/threats/cve-2025-1691-mongodb-mongosh-control-character-injection-in-autocomplete)
- [MongoDB Shell control character injection via shell output](https://junglewise.ai/threats/cve-2025-1693-mongodb-shell-control-character-injection-via-shell-output)
- [MongoDB Shell control character injection via clipboard paste](https://junglewise.ai/threats/cve-2025-1692-mongodb-shell-control-character-injection-via-clipboard-paste)
