CVE-2026-96747
PyMongo: PYTHON-5990 Forced Unix domain socket connection via a .sock KMS endpoint in client-side field level encryption
Published Oct 5, 2026 · updated Oct 15, 2026
### Summary PyMongo passed the KMS endpoint of a data key verbatim into , which returns any string ending in unchanged instead of validating it as a hostname and port. The driver's connection code then treats such an address as a Unix domain socket path and connects to it with . Because the endpoint originates from in a key vault document, a party who can write to the key vault could redirect the driver's KMS connection to an arbitrary Unix domain socket path on the application host. ### Impact An application using client-side field level encryption (CSFLE) or Queryable Encryption is affected if an attacker can write to its key vault collection. Setting on a data key to a -suffixed string causes the next KMS request for that key (key cache TTL is ~60 seconds) to open an connection to the attacker-chosen filesystem path from inside the victim application process. The documented custom KMS endpoint feature supports TCP hosts only, so this crosses a boundary the feature was never intended to allow. Impact is limited to the side effects of the connection itself. The socket is still wrapped in a verifying TLS context using the string as , and insecure KMS TLS options are rejected, so the handshake always fails and the KMS message is never sent. The attacker controls the connect target but not the transmitted bytes (a fixed TLS ClientHello). Applications that do not use CSFLE or Queryable Encryption are not affected. Applications whose key vault is not writable by untrusted parties are not affected. ### Patches Fixed in PyMongo 4.18.2 now rejects a -suffixed KMS endpoint with immediately after parsing, before any connection is attempted, on both the synchronous and asynchronous paths. No application code changes are required beyond upgrading. ### Workarounds If you cannot upgrade immediately: - Restrict write access to the key vault collection to trusted principals only. This is the recommended configuration regardless of this issue. - Validate on data keys you create, an
Code
The project this record applies to. Exploit listings stay in References.
Timeline
Detection, updates, and resolution for this record.
Oct 5, 2026 · GitHub Advisory Database
Detected
### Summary PyMongo passed the KMS endpoint of a data key verbatim into , which returns any string ending in unchanged instead of validating it as a hostname and port. The driver's connection code then treats such an address as a Unix domain socket path and connects to it with . Because the endpoint originates from in a key vault document, a party who can write to the key vault could redirect the
Oct 15, 2026 · GitHub Advisory Database
Fix available
pymongo fixed in 4.18.2
Oct 15, 2026 · GitHub Advisory Database
Fix available
pymongo fixed in 4.18.2
Oct 15, 2026 · GitHub Advisory Database
Updated
### Summary PyMongo passed the KMS endpoint of a data key verbatim into , which returns any string ending in unchanged instead of validating it as a hostname and port. The driver's connection code then treats such an address as a Unix domain socket path and connects to it with . Because the endpoint originates from in a key vault document, a party who can write to the key vault could redirect the
Affected
- PyPI pymongo3.9.0 → 4.18.2
Sources
- CVE.orgVulnerability recordCVE-2026-96747
Official CVE identifier
cve.org - GitHub Advisory DatabasePackage advisoryGHSA-qx36-8mw2-4r3x
GitHub Advisory Database record mirrored by OSV.
github.com - OSV.devPackage advisoryGHSA-qx36-8mw2-4r3x
PyMongo: PYTHON-5990 Forced Unix domain socket connection via a .sock KMS endpoint in client-side field level encryption
osv.dev