Vulnerabilities in pkg:npm/mongosh

PACKAGE
Advisory Identifier: GHSA-f5w3-73h4-jpcm
Advisory Summary

CVE-2025-1756 is a HIGH (CVSS 7.5) mongosh vulnerable to local privilege vulnerability (CWE-426: Untrusted Search Path) affecting Mongosh libraries in the npm ecosystem. The issue involves mongosh vulnerable to local privilege escalation. Remediation is available by upgrading affected packages to version 2.3.0.

4 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/mongosh

4 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/mongosh. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-f5w3-73h4-jpcm CVE-2025-1756 HIGH mongosh vulnerable to local privilege escalation
GHSA-r95j-4jvf-mrrw CVE-2025-1693 LOW MongoDB Shell may be susceptible to control character Injection via shell output
GHSA-973h-3x6p-qg37 CVE-2025-1692 MODERATE MongoDB Shell may be susceptible to control character injection via pasting
GHSA-43g5-2wr2-q7vj CVE-2025-1691 HIGH MongoDB Shell may be susceptible to Control Character Injection via autocomplete

CVE-2025-1756 at a Glance

CVE Identifier CVE-2025-1756
GHSA Identifier GHSA-f5w3-73h4-jpcm
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-426: Untrusted Search Path
Affected Product Mongosh
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:H).

Attack Vector Local (AV:L)
Attack Complexity High (AC:H)
Privileges Required Low (PR:L)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2025-1756

To remediate this vulnerability, upgrade all affected Mongosh dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

mongosh fixed: 2.3.0
npm install mongosh@2.3.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls mongosh

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2025-1756, inspect your project dependencies using npm:

npm ls mongosh

Analyze the terminal output to locate any version of Mongosh in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.3.0), your application is affected.

Note: The npm ls mongosh command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-426: Untrusted Search Path, where the product searches for critical resources using an externally-supplied search path that can point to resources that are not under the product's direct control. In Mongosh, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

mongosh may be susceptible to local privilege escalation under certain conditions potentially enabling unauthorized actions on a user's system with elevated privilege, when a crafted file is stored in C:\node_modules\. This issue affects mongosh prior to 2.3.0.

CVE-2025-1756 Affected Mongosh Versions

1 component(s)
Fixed Versions:
2.3.0
Product / Package Ecosystem Affected Versions Fixed Version
mongosh
npm
< 2.3.0
2.3.0

References

Frequently Asked Questions

What is CVE-2025-1756?
CVE-2025-1756 is a security vulnerability in Mongosh involving mongosh vulnerable to local privilege escalation under CWE-426: Untrusted Search Path.
Which Mongosh versions are affected?
Affected versions include releases prior to 2.3.0 across affected packages: mongosh.
What version fixes CVE-2025-1756?
Upgrading to 2.3.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is mongosh affected?
Yes, mongosh is affected in releases prior to 2.3.0. Upgrade your dependency to 2.3.0 or later.
What is the CVSS score of CVE-2025-1756?
CVE-2025-1756 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:H.
What CWE is associated with CVE-2025-1756?
CVE-2025-1756 is classified under CWE-426: Untrusted Search Path (The product searches for critical resources using an externally-supplied search path that can point to resources that are not under the product's direct control.).
How can I check npm dependencies for CVE-2025-1756?
Run the dependency tree command: 'npm ls mongosh'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-f5w3-73h4-jpcm",
  "modified" : "2025-02-27T20:59:00Z",
  "published" : "2025-02-27T18:31:13Z",
  "aliases" : [ "CVE-2025-1756" ],
  "summary" : "mongosh vulnerable to local privilege escalation",
  "details" : "mongosh may be susceptible to local privilege escalation under certain conditions potentially enabling unauthorized actions on a user's system with elevated privilege, when a crafted file is stored in C:\\node_modules\\. This issue affects mongosh prior to 2.3.0.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "mongosh"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.3.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-1756"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2025:1756"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/mongodb-js/mongosh"
  }, {
    "type" : "WEB",
    "url" : "https://jira.mongodb.org/browse/MONGOSH-2028"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-426" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-02-27T20:59:00Z",
    "nvd_published_at" : "2025-02-27T16:15:39Z"
  }
}