CVE-2026-126982 · Package
NO FIX YET
The BSON serialization library in the MongoDB C# Driver can be tricked into building .NET types that the application's allow-list should block when it reads polymorphic data. An attacker who can supply BSON or JSON the application later deserializes may get code execution in the application process if a suitable gadget type is present.
first public Nov 13, 2026 · 2 sources
Check it with your coding agent
It reads this page and tells you if your code or app is affected.
Applications that use the MongoDB C# Driver's BSON library to deserialize polymorphic data into loosely typed members, where the data can come from an untrusted party. Applications that only read trusted, fixed-shape documents, or that do not use polymorphic deserialization, are less exposed. Whether a suitable gadget type exists depends on the application's dependencies, which the sources do not say.
Not affected if no-polymorphic-deserialization, trusted-data-only
Who cares bson, csharp, dotnet, mongodb, nuget
Unknown from the sources.
A type allow-list bypass in the BSON serialization library of the MongoDB C# Driver allows a type-restriction check to be circumvented when polymorphic data is deserialized into loosely typed members. An unauthorized party who can supply or plant BSON/JSON data that the application later deserializes can cause the application process to instantiate .NET types outside the intended allow-list and populate them with unauthorized party-controlled values. In applications that contain a suitable gadget type, this can lead to arbitrary code execution in the context of the application, with corresponding loss of confidentiality, integrity, and availability. No special privileges beyond the ability to introduce data the application reads are required.
This page as .md · .json · CVSS:4.0/AV:N/AC:H/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
NVD data is provided by NIST and is public domain. Posts quoted belong to their authors.
Are you affected?
Ask from here. InfraStack checks the affected versions against your stack and answers in your inbox.
InfraStack checks the affected versions against your stack and answers in Slack, with the evidence and the fix.
InfraStack checks it against your stack and answers on your report, with the evidence and the fix.