CVE-2025-1693: Mongosh MongoDB Shell May Be Susceptible Vulnerability

LOW
Advisory Identifier: GHSA-r95j-4jvf-mrrw
CVSS 3.9
CWE-150
Published
Advisory Summary

CVE-2025-1693 is a LOW (CVSS 3.9) mongodb shell may be susceptible vulnerability (CWE-150: Improper Neutralization of Escape, Meta, or Control Sequences) affecting Mongosh libraries in the npm ecosystem. The issue involves mongodb shell may be susceptible to control character injection via shell output. Remediation is available by upgrading affected packages to version 2.3.9.

CVE-2025-1693 at a Glance

CVE Identifier CVE-2025-1693
GHSA Identifier GHSA-r95j-4jvf-mrrw
Severity LOW
CVSS v3.1 Base Score 3.9
CWE Classification CWE-150: Improper Neutralization of Escape, Meta, or Control Sequences
Affected Product Mongosh
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 3.9

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

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

How to Fix CVE-2025-1693

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.9
npm install mongosh@2.3.9
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-1693, 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.9), 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-150: Improper Neutralization of Escape, Meta, or Control Sequences, where the product receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as escape, meta, or control character sequences when they are sent to a downstream component. 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

The MongoDB Shell may be susceptible to control character injection where an attacker with control over the database cluster contents can inject control characters into the shell output. This may result in the display of falsified messages that appear to originate from mongosh or the underlying operating system, potentially misleading users into executing unsafe actions. The vulnerability is exploitable only when mongosh is connected to a cluster that is partially or fully controlled by an attacker. This issue affects mongosh versions prior to 2.3.9.

CVE-2025-1693 Affected Mongosh Versions

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

References

Frequently Asked Questions

What is CVE-2025-1693?
CVE-2025-1693 is a security vulnerability in Mongosh involving MongoDB Shell may be susceptible to control character Injection via shell output under CWE-150: Improper Neutralization of Escape, Meta, or Control Sequences.
Which Mongosh versions are affected?
Affected versions include releases prior to 2.3.9 across affected packages: mongosh.
What version fixes CVE-2025-1693?
Upgrading to 2.3.9 (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.9. Upgrade your dependency to 2.3.9 or later.
What is the CVSS score of CVE-2025-1693?
CVE-2025-1693 has a CVSS v3.1 base score of 3.9 (LOW) with vector string CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:L/I:L/A:L.
What CWE is associated with CVE-2025-1693?
CVE-2025-1693 is classified under CWE-150: Improper Neutralization of Escape, Meta, or Control Sequences (The product receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as escape, meta, or control character sequences when they are sent to a downstream component.).
How can I check npm dependencies for CVE-2025-1693?
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-r95j-4jvf-mrrw",
  "modified" : "2025-02-27T17:16:09Z",
  "published" : "2025-02-27T15:31:51Z",
  "aliases" : [ "CVE-2025-1693" ],
  "summary" : "MongoDB Shell may be susceptible to control character Injection via shell output",
  "details" : "The MongoDB Shell may be susceptible to control character injection where an attacker with control over the database cluster contents can inject control characters into the shell output. This may result in the display of falsified messages that appear to originate from mongosh or the underlying operating system, potentially misleading users into executing unsafe actions.\n\nThe vulnerability is exploitable only when mongosh is connected to a cluster that is partially or fully controlled by an attacker.\n\nThis issue affects mongosh versions prior to 2.3.9.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:L/I:L/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "mongosh"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.3.9"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-1693"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/mongodb-js/mongosh"
  }, {
    "type" : "WEB",
    "url" : "https://jira.mongodb.org/browse/MONGOSH-2026"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-150" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-02-27T17:16:09Z",
    "nvd_published_at" : "2025-02-27T13:15:11Z"
  }
}