CVE-2026-141347: Remote code execution via unvalidated discriminator-driven class loading in POJO decoding
A deserialization flaw in the BSON object-mapping component of the MongoDB Java Driver allows a type-name value carried inside a document to select which Java class the embedding application loads and builds. A party able to place a document into a collection the application later reads can cause the application to load, initialize and populate an arbitrary class that is present on its classpath, with field values taken from the same document. This may result in unintended changes to application state and in failures when the affected records are read.
Affected Software
Event History
Frequently Asked Questions
Who is exposed to this issue?
Applications using the MongoDB Java Driver's BSON object-mapping component are exposed if they read documents from a collection where another party can place or modify records. The risk depends on attacker-controlled documents later being decoded by the application.
What does an attacker need to exploit it?
An attacker needs the ability to place a document into a collection that the application later reads. They can supply a type-name value that influences class selection, but exploitation is limited to classes already present on the application's classpath.
Does successful exploitation require user interaction or prior application privileges?
No user interaction is required. The provided severity vector indicates low attack complexity and requires low privileges, consistent with an attacker who can write a record that the application subsequently processes.
What can happen when a malicious document is read?
The application may load, initialize, and populate an arbitrary class from its classpath using values in the document. This can cause unintended application-state changes and failures while reading affected records.