CVE-2025-1692 MongoDB Shell may be susceptible to control character injection via pasting

Medium 6.3 Published Updated

An attacker with clipboard access can inject control characters into the MongoDB Shell to execute arbitrary code via pasted text.

Exploited in the wild
Not known
Login needed
An administrator
Attackable
Local or same network only
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2025-1692?

CVE-2025-1692 is a medium-severity code injection vulnerability in MongoDB Inc mongosh, published on 27 Feb 2025. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

Official description

The MongoDB Shell may be susceptible to control character injection where an attacker with control of the user’s clipboard could manipulate them to paste text into mongosh that evaluates arbitrary code. Control characters in the pasted text can be used to obfuscate malicious code. This issue affects mongosh versions prior to 2.3.9

Weakness: CWE-150

Which versions are affected by CVE-2025-1692?

2 open source packages ship an affected version, including mongosh. It affects 1 product.

PackageAffectedFixed in
mongosh npmAll versions2.3.9
mongosh npmAll versions2.3.9

Products include Mongodb Mongosh.

How do I fix CVE-2025-1692?

Upgrade mongosh to 2.3.9 or later.

Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.

Is CVE-2025-1692 being exploited?

There is no known exploitation of CVE-2025-1692 in the wild and no public exploit code.

Sources

Also known as GHSA-973h-3x6p-qg37.

Is CVE-2025-1692 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free