MongoDB Shell may be susceptible to control character Injection via shell output
Description
MongoDB Shell (mongosh) prior to 2.3.9 is vulnerable to control character injection, allowing an attacker controlling the database cluster to inject falsified messages into shell output, potentially misleading users.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
MongoDB Shell (mongosh) prior to 2.3.9 is vulnerable to control character injection, allowing an attacker controlling the database cluster to inject falsified messages into shell output, potentially misleading users.
Vulnerability
Details
The MongoDB Shell (mongosh) is susceptible to a control character injection vulnerability (CWE-150) where an attacker with control over the database cluster contents can inject control characters into the shell output [1][2][3]. This occurs because mongosh does not properly neutralize escape, meta, or control sequences when displaying data retrieved from the cluster, allowing arbitrary control characters to be embedded in the output stream.
Exploitation
Exploitation requires the attacker to have partial or full control over the database cluster to which mongosh is connected [2][3]. The attacker can then embed control characters in database documents or responses that mongosh renders. The user must be actively using mongosh to query the attacker-controlled cluster, and the attack relies on user interaction (e.g., reading the falsified output) to be effective. The CVSS vector (AV:N/AC:H/PR:H/UI:R/S:U/C:L/I:L/A:L) reflects these constraints, resulting in a base score of 3.9 [3].
Impact
Successful exploitation allows the attacker to display falsified messages that appear to originate from mongosh or the underlying operating system [1][2]. This can mislead users into executing unsafe actions, such as running malicious commands or revealing sensitive information, based on the deceptive output. The impact is limited to low confidentiality, integrity, and availability compromise.
Mitigation
The vulnerability is fixed in mongosh version 2.3.9 [1][2][3]. Users are advised to upgrade to this version or later. No workarounds are documented; the only mitigation is to avoid connecting mongosh to untrusted or attacker-controlled clusters until the update is applied.
AI Insight generated on May 20, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
mongoshnpm | < 2.3.9 | 2.3.9 |
Affected products
2- MongoDB Inc/mongoshv5cpe:2.3:a:mongodb:mongosh:0.2.2:*:*:*:*:*:*:*Range: 0
Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
3- github.com/advisories/GHSA-r95j-4jvf-mrrwghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2025-1693ghsaADVISORY
- jira.mongodb.org/browse/MONGOSH-2026ghsaWEB
News mentions
0No linked articles in our index yet.