Executive brief
The MongoDB Java Driver's client-side encryption feature can crash an application when an encrypted database operation is cancelled (due to network timeout or client disconnect). When cancellation occurs during credential fetching, native memory is freed prematurely while still in use, causing the application process to terminate or potentially corrupt encryption key storage. This affects applications using reactive (async) database connections with on-demand KMS credential fetching.
Technical details
The vulnerability is a use-after-free in the reactive client-side encryption component (libmongocrypt) arising from a race condition between the cancellation path and in-flight encryption state-machine operations. When an operation is cancelled, the driver frees the native libmongocrypt context from a finally block without synchronization, while another thread may still be executing a state-machine step that accesses the same context. The root cause is missing locking around native context calls and improper ordering of resource cleanup. Exploitation requires a reactive encryption configuration with on-demand KMS credential supply (via kmsProviderPropertySupplier). The impact is process termination or memory corruption affecting encryption key material. MongoDB Java Driver versions prior to 5.11.1 are affected; the fix introduces proper synchronization via locking around native calls and close() operations.
Affected products
- MongoDB Java Driver before 5.11.1
Timeline
- 2026-09-10: disclosed: CVE-2026-88032 published
- 2026-09-10: patched: Fixed in MongoDB Java Driver 5.11.1