Untrusted search path in MongoDB mongosh may enable local privilege escalation on Windows

Note: This data is for reference and cybersecurity research purposes only.CyStack advises users not to use this information for unlawful purposes.

What is CVE-2025-1756?

CVE-2025-1756 is a vulnerability classified as Untrusted Search Path, affecting mongosh (affected versions: < 2.3.0). This vulnerability is rated High, with a CVSS score of 7.8. Current sources do not report this vulnerability as exploited.

Overview

Original source data

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

Affected products and scope

  • MongoDB Inc mongosh: The normalized record marks the custom range from version 0 through versions less than 2.3.0 as affected.
  • Platform: MongoDB states that only environments using Windows as the underlying operating system are affected.
  • Fixed version: MongoDB's Jira record identifies 2.3.0 as the fixed version. This entry should not be interpreted as independently verifying every later or parallel release branch.

Technical details

MongoDB mongosh has a CWE-426 Untrusted Search Path flaw. On Windows, a crafted file can be stored in C:\node_modules\; under certain conditions, mongosh's path-search behavior may result in unauthorized actions with elevated privilege. The available evidence confirms the Windows requirement and the relevant file location, but does not describe the exact lookup, loading, or execution sequence. Exploitation requires local access and the ability to place or control a file at that location. NVD's normalized assessment describes low attacker privileges and no user interaction, while MongoDB's assessment describes higher complexity and required user interaction, so the detailed exploitation conditions remain inconsistent across assessments. The affected scope is mongosh before 2.3.0.

Exploitability

  • Reachability: The issue is locally reachable on Windows systems; the available evidence does not establish a remote network attack path.
  • Preconditions: A crafted file must be present in C:\node_modules\, along with additional conditions that MongoDB has not described in detail.
  • Privileges and interaction: The normalized NVD record describes low attacker privileges and no user interaction. MongoDB's assessment describes high complexity and required user interaction, so these conditions should not be collapsed into one definitive model.
  • Exploitation status: The supplied record does not mark the issue as known exploited and states that no public exploit is available. The CISA enrichment shown in the GCVE record lists exploitation as none and automatable as no, but that does not prove that exploitation has never occurred outside that record's scope.

Technical impact

The flaw may result in unauthorized actions with elevated privilege on the same Windows system. Potential technical consequences include reading or disclosing data, changing data or system configuration, and disrupting services to the extent allowed by the obtained privilege. NVD's assessment describes the impact as confined to the local system, while MongoDB's assessment describes a scope change; this difference reflects limited public detail about the complete attack chain. No evidence identifies a specific attack, victim, or breach.

Business impact

Successful exploitation could allow unauthorized actions with elevated privilege on the local Windows system. The record indicates potentially high impact to confidentiality, integrity, and availability. Because the issue is local, the presence of mongosh on a server does not by itself create an Internet attack path; an attacker still needs a way to interact with the system or place a file in the relevant location. The evidence does not confirm a specific data disclosure, service disruption, or compromise scenario.

Remediation

  1. Upgrade mongosh to 2.3.0, the version MongoDB identifies as containing the fix. Verify the deployed version on every affected Windows host.
  2. If an upgrade cannot be completed, restrict or remove write access for untrusted local users and processes to C:\node_modules\. This is precautionary containment, not a MongoDB-confirmed workaround.
  3. Review overlooked mongosh installations in user profiles, development environments, and internal package distributions, and replace versions before 2.3.0.
  4. No additional vendor-specific mitigation is provided in the record or the consulted material. The status of branches not explicitly covered should be verified against the corresponding MongoDB release guidance.

Detection

  1. Inventory every mongosh installation on Windows hosts, including per-user installations, system-wide installations, and copies bundled with development tools; compare each version with the before 2.3.0 boundary.
  2. Check whether C:\node_modules\ exists and determine which local accounts, processes, or automation tools can create, modify, or replace files there.
  3. Where file auditing or EDR is available, review file creation and modification activity under C:\node_modules\ near mongosh execution, together with mongosh launches using elevated tokens. This is precautionary monitoring, not a vendor-confirmed IOC.
  4. No specific log event, IOC, or file pattern is provided by the available evidence. The absence of suspicious telemetry does not prove that a system is safe.
Sources (24)
Learn more

Run an in-depth assessment with complete web risk management

CyStack VulnScan continuously discovers assets, validates vulnerabilities, and helps security teams prioritize remediation across the organization.