MongoDB .NET/C# Driver vulnerable to Deserialization of Untrusted DataGHSA-7j9m-j397-g4wx
HIGHGHSA-7j9m-j397-g4wx is a high-severity (CVSS 7.2) Deserialization of Untrusted Data vulnerability in MongoDB.Driver. A fix is available for MongoDB.Driver — see the affected versions and patch details below.
Exploitation Status
No confirmed exploitation observed yet
- A successful exploit gives an attacker total control of the affected component, not partial access.
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for GHSA-7j9m-j397-g4wx.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
MongoDB.DriverReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects NuGet packages — download data is not available via public APIs for these ecosystems.
Description
Under very specific circumstances (see Required configuration section below), a privileged user is able to cause arbitrary code to be executed which may cause further disruption to services. This is specific to applications written in C#. This affects all MongoDB .NET/C# Driver versions prior to and including v2.18.0
Following configuration must be true for the vulnerability to be applicable: * Application must written in C# taking arbitrary data from users and serializing data using _t without any validation AND
- Application must be running on a Windows host using the full .NET Framework, not .NET Core AND
- Application must have domain model class with a property/field explicitly of type System.Object or a collection of type System.Object (against MongoDB best practice) AND
- Malicious attacker must have unrestricted insert access to target database to add a _t discriminator."Following configuration must be true for the vulnerability to be applicable
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| .NETNuGet | MongoDB.Driver | all versions | 2.19.0dotnet add package MongoDB.Driver --version 2.19.0 |
Affected Products
c\# drivermongodbDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for MongoDB.Driver, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update MongoDB.Driver to 2.19.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-7j9m-j397-g4wx is resolved across your whole dependency graph.
Workarounds
Do not deserialise data from untrusted sources: where the format allows it, restrict deserialisation to an explicit allowlist of expected types, and prefer a data-only format (JSON, Protobuf) over one that can reconstruct arbitrary objects until you can upgrade.
Frequently Asked Questions
Is GHSA-7j9m-j397-g4wx in your dependencies?
Find it across NuGet, including transitive dependencies.