CVE-2026-96747
Forced local Unix socket connection via dot-sock KMS endpoint in client-side field encryption
The client-side field level encryption support in the MongoDB Python Driver can treat a key management endpoint value ending in ".sock" as a local Unix domain socket path rather than a remote host. A user with write access to the encryption key metadata stored in the database can cause an application using the driver to open connections to local sockets on the application host. Data sent over these connections is limited to the start of a TLS handshake, so no chosen content is transmitted.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- Low
- User interaction
- None
What an attacker can affect
- Confidentiality
- None
- Integrity
- None
- Availability
- None
Exploit likelihood
What each source reports
CVE List Score used
5.3
Forced local Unix socket connection via dot-sock KMS endpoint in client-side field encryption
The client-side field level encryption support in the MongoDB Python Driver can treat a key management endpoint value ending in ".sock" as a local Unix domain socket path rather than a remote host. A user with write access to the encryption key metadata stored in the database can cause an application using the driver to open connections to local sockets on the application host. Data sent over these connections is limited to the start of a TLS handshake, so no chosen content is transmitted.
- Record
CVE-2026-96747- CVSS 4.0
- 5.3 Medium
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:N/SC:L/SI:N/SA:N - CVSS 3.1
- 5.0 Medium
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:N/A:N - Weakness
- CWE-918
- Updated
- 2026-11-02
EUVDEUVD-2026-86346
5.3
The client-side field level encryption support in the MongoDB Python Driver can treat a key management endpoint value ending in ".sock" as a local Unix domain socket path rather than a remote host. A user with write access to the encryption key metadata stored in the database can cause an application using the driver to open connections to local sockets on the application host. Data sent over these connections is limited to the start of a TLS handshake, so no chosen content is transmitted.
- Record
EUVD-2026-86346- CVSS 4.0
- 5.3 Medium
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:N/SC:L/SI:N/SA:N - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-qx36-8mw2-4r3x
5.3
PyMongo: PYTHON-5990 Forced Unix domain socket connection via a .sock KMS endpoint in client-side field level encryption
Summary
PyMongo passed the KMS endpoint of a data key verbatim into parse_host(), which returns any string ending in .sock 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 AF_UNIX. Because the endpoint originates from masterKey.endpoint 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 masterKey.endpoint on a data key to a .sock-suffixed string causes the next KMS request for that key (key cache TTL is ~60 seconds) to open an AF_UNIX 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 .sock string as server_hostname, 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 _EncryptionIO.kms_request now rejects a .sock-suffixed KMS endpoint with pymongo.errors.ConfigurationError 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
masterKey.endpointon data keys you create, and audit existing key vault documents for endpoints ending in.sock.
Details
_EncryptionIO.fetch_keysreads key vault documents from the server and hands them to libmongocrypt, which surfaces the storedmasterKey.endpointverbatim askms_context.endpoint._EncryptionIO.kms_requestpassed that string toparse_host(endpoint, 443).parse_hostreturns entities ending in.sockverbatim, skipping the hostname and port validation applied to every other input._create_connection(and the async equivalent) checkshost.endswith(".sock")and performs anAF_UNIXsock.connect(host), treating the string as a filesystem path.
- Record
GHSA-qx36-8mw2-4r3x- CVSS 4.0
- 5.3 Medium
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:N/SC:L/SI:N/SA:N - CVSS 3.1
- 5.0 Medium
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:N/A:N - Weakness
- CWE-20, CWE-918
- Updated
- 2026-11-02
NVD
5.3
The client-side field level encryption support in the MongoDB Python Driver can treat a key management endpoint value ending in ".sock" as a local Unix domain socket path rather than a remote host. A user with write access to the encryption key metadata stored in the database can cause an application using the driver to open connections to local sockets on the application host. Data sent over these connections is limited to the start of a TLS handshake, so no chosen content is transmitted.
- Record
CVE-2026-96747- CVSS 4.0
- 5.3 Medium
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:N/SC:L/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 - CVSS 3.1
- 5.0 Medium
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:N/A:N - Weakness
- CWE-918
- Updated
- 2026-11-02
OSV
5.3
Forced local Unix socket connection via dot-sock KMS endpoint in client-side field encryption
The client-side field level encryption support in the MongoDB Python Driver can treat a key management endpoint value ending in ".sock" as a local Unix domain socket path rather than a remote host. A user with write access to the encryption key metadata stored in the database can cause an application using the driver to open connections to local sockets on the application host. Data sent over these connections is limited to the start of a TLS handshake, so no chosen content is transmitted.
- Record
CVE-2026-96747- CVSS 4.0
- 5.3 Medium
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:N/SC:L/SI:N/SA:N - Weakness
- CWE-918
- Updated
- 2026-11-02
OSVDEBIAN-CVE-2026-96747
5.3
The client-side field level encryption support in the MongoDB Python Driver can treat a key management endpoint value ending in ".sock" as a local Unix domain socket path rather than a remote host. A user with write access to the encryption key metadata stored in the database can cause an application using the driver to open connections to local sockets on the application host. Data sent over these connections is limited to the start of a TLS handshake, so no chosen content is transmitted.
- Record
DEBIAN-CVE-2026-96747- CVSS 4.0
- 5.3 Medium
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:N/SC:L/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 - Updated
- 2026-11-02
Show 7 moreShow less
OSVGHSA-qx36-8mw2-4r3x
5.3
PyMongo: PYTHON-5990 Forced Unix domain socket connection via a .sock KMS endpoint in client-side field level encryption
Summary
PyMongo passed the KMS endpoint of a data key verbatim into parse_host(), which returns any string ending in .sock 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 AF_UNIX. Because the endpoint originates from masterKey.endpoint 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 masterKey.endpoint on a data key to a .sock-suffixed string causes the next KMS request for that key (key cache TTL is ~60 seconds) to open an AF_UNIX 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 .sock string as server_hostname, 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 _EncryptionIO.kms_request now rejects a .sock-suffixed KMS endpoint with pymongo.errors.ConfigurationError 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
masterKey.endpointon data keys you create, and audit existing key vault documents for endpoints ending in.sock.
Details
_EncryptionIO.fetch_keysreads key vault documents from the server and hands them to libmongocrypt, which surfaces the storedmasterKey.endpointverbatim askms_context.endpoint._EncryptionIO.kms_requestpassed that string toparse_host(endpoint, 443).parse_hostreturns entities ending in.sockverbatim, skipping the hostname and port validation applied to every other input._create_connection(and the async equivalent) checkshost.endswith(".sock")and performs anAF_UNIXsock.connect(host), treating the string as a filesystem path.
- Record
GHSA-qx36-8mw2-4r3x- CVSS 4.0
- 5.3 Medium
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:N/SC:L/SI:N/SA:N - CVSS 3.1
- 5.0 Medium
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:N/A:N - Weakness
- CWE-20, CWE-918
- Updated
- 2026-11-02
OSVPYSEC-2026-4295
5.3
PyMongo: PYTHON-5990 Forced Unix domain socket connection via a .sock KMS endpoint in client-side field level encryption
Summary
PyMongo passed the KMS endpoint of a data key verbatim into parse_host(), which returns any string ending in .sock 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 AF_UNIX. Because the endpoint originates from masterKey.endpoint 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 masterKey.endpoint on a data key to a .sock-suffixed string causes the next KMS request for that key (key cache TTL is ~60 seconds) to open an AF_UNIX 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 .sock string as server_hostname, 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 _EncryptionIO.kms_request now rejects a .sock-suffixed KMS endpoint with pymongo.errors.ConfigurationError 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
masterKey.endpointon data keys you create, and audit existing key vault documents for endpoints ending in.sock.
Details
_EncryptionIO.fetch_keysreads key vault documents from the server and hands them to libmongocrypt, which surfaces the storedmasterKey.endpointverbatim askms_context.endpoint._EncryptionIO.kms_requestpassed that string toparse_host(endpoint, 443).parse_hostreturns entities ending in.sockverbatim, skipping the hostname and port validation applied to every other input._create_connection(and the async equivalent) checkshost.endswith(".sock")and performs anAF_UNIXsock.connect(host), treating the string as a filesystem path.
- Record
PYSEC-2026-4295- CVSS 4.0
- 5.3 Medium
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:N/SC:L/SI:N/SA:N - CVSS 3.1
- 5.0 Medium
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:N/A:N - Updated
- 2026-11-02
OSVUBUNTU-CVE-2026-96747
5.3
The client-side field level encryption support in the MongoDB Python Driver can treat a key management endpoint value ending in ".sock" as a local Unix domain socket path rather than a remote host. A user with write access to the encryption key metadata stored in the database can cause an application using the driver to open connections to local sockets on the application host. Data sent over these connections is limited to the start of a TLS handshake, so no chosen content is transmitted.
- Record
UBUNTU-CVE-2026-96747- CVSS 4.0
- 5.3 Medium
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:N/SC:L/SI:N/SA:N - CVSS 3.1
- 5.0 Medium
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:N/A:N - Updated
- 2026-11-02
OSVAZL-105113 No score
CVE-2026-96747 affecting package python-pymongo 4.2.0-9
The client-side field level encryption support in the MongoDB Python Driver can treat a key management endpoint value ending in ".sock" as a local Unix domain socket path rather than a remote host. A user with write access to the encryption key metadata stored in the database can cause an application using the driver to open connections to local sockets on the application host. Data sent over these connections is limited to the start of a TLS handshake, so no chosen content is transmitted.
- Record
AZL-105113- Updated
- 2026-11-05
OSVopenSUSE-SU-2026:11935-1 No score
python313-pymongo-4.18.2-1.1 on GA media
These are all security issues fixed in the python313-pymongo-4.18.2-1.1 package on the GA media of openSUSE Tumbleweed.
- Record
openSUSE-SU-2026:11935-1- Updated
- 2026-11-02
OSVopenSUSE-SU-2026:22003-1 No score
Security update for python-pymongo
This update for python-pymongo fixes the following issues:
Changes in python-pymongo:
- CVE-2026-96749: integer overflow in BSON document encoding allows an unprivileged user to write outside the bounds of an allocated buffer (bsc#1282845)
- CVE-2026-96748: host injection in connection string leading to database connection redirection due to improper connection string parsing (bsc#1282827)
- CVE-2026-96747: improper handling of key management endpoint values
ending in
.sockallows users with write access to the encryption key metadata to open connections to local sockets on the application host (bsc#1282844)
- Record
openSUSE-SU-2026:22003-1- Updated
- 2026-11-02
OSVSUSE-SU-2026:4398-1 No score
Security update for python-pymongo
This update for python-pymongo fixes the following issues:
- CVE-2026-96747: improper handling of key management endpoint values ending in
.sockallows users with write access to the encryption key metadata to open connections to local sockets on the application host (bsc#1282844). - CVE-2026-96748: host injection in connection string leading to database connection redirection due to improper connection string parsing (bsc#1282827).
- CVE-2026-96749: integer overflow in BSON document encoding allows an unprivileged user to write outside the bounds of an allocated buffer (bsc#1282845).
- Record
SUSE-SU-2026:4398-1- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
pymongoPyPI |
3.9.0 to 4.18.1 | 4.18.2 |
python-pymongoAzure Linux:3 |
through 4.2.0-9 | None known |
pymongoDebian:12 |
All versions, plus listed versions 3.11.0-13.11.0-1+deb12u14.10.1-14.10.1-24.10.1-3 Show 14 moreShow less4.10.1-44.10.1-54.10.1-64.15.3-14.15.3-24.15.4-14.15.4-24.15.5-14.16.0-14.17.0-14.18.1-14.18.2-14.7.3-14.7.3-2 |
None known |
pymongoDebian:13 |
All versions, plus listed versions 4.10.1-64.15.3-14.15.3-24.15.4-14.15.4-2 Show 5 moreShow less4.15.5-14.16.0-14.17.0-14.18.1-14.18.2-1 |
None known |
pymongoDebian:14 |
before 4.18.2-1, plus listed versions 4.10.1-64.15.3-14.15.3-24.15.4-14.15.4-2 Show 4 moreShow less4.15.5-14.16.0-14.17.0-14.18.1-1 |
4.18.2-1 |
pymongoPyPI |
3.9.0 up to 4.18.2, plus listed versions 3.10.03.10.13.11.03.11.13.11.2 Show 45 moreShow less3.11.33.11.43.12.03.12.13.12.23.12.33.13.04.04.0.14.0.24.1.04.1.14.10.04.10.14.114.11.14.11.24.11.34.12.04.12.14.13.04.13.0.dev04.13.14.13.24.14.04.14.14.15.04.15.14.15.24.15.34.15.44.15.54.16.04.16.0.dev04.17.04.18.04.18.14.2.04.3.24.3.34.4.04.4.0b04.4.14.5.04.6.0 |
4.18.2 |
python-pymongoSUSE:Linux Enterprise Module for Package Hub 15 SP7 From an advisory covering 3 CVEs |
before 3.11.0-150300.3.6.1 | 3.11.0-150300.3.6.1 |
pymongoUbuntu:14.04:LTS |
All versions, plus listed versions 2.6-12.6.2-12.6.3-12.6.3-1build1 |
None known |
pymongoUbuntu:Pro:16.04:LTS |
All versions, plus listed versions 3.0.3-13.2-13.2-1build13.2-1ubuntu0.1~esm1 |
None known |
pymongoUbuntu:Pro:18.04:LTS |
All versions, plus listed versions 3.4.0-1build23.6.1+dfsg1-13.6.1+dfsg1-1ubuntu0.1~esm1 |
None known |
Show 7 moreShow less
| Package | Affected | Fixed |
|---|---|---|
pymongoUbuntu:20.04:LTS |
All versions, plus listed versions 3.7.1-1.13.7.1-1.1build13.10.1-0ubuntu23.10.1-0ubuntu2.1 |
None known |
pymongoUbuntu:22.04:LTS |
All versions, plus listed versions 3.11.0-1build23.11.0-1build33.11.0-1build43.11.0-1ubuntu0.22.04.1 |
None known |
pymongoUbuntu:24.04:LTS |
All versions, plus listed versions 3.11.0-1build63.11.0-1build73.11.0-1build83.11.0-1ubuntu0.24.04.1 |
None known |
pymongoUbuntu:26.10 |
All versions, plus listed versions 4.16.0-1build14.17.0-1 |
None known |
pymongoUbuntu:26.04:LTS |
All versions, plus listed versions 4.10.1-64.15.3-14.15.3-24.15.5-14.16.0-14.16.0-1build1 |
None known |
python-pymongoopenSUSE:Tumbleweed From an advisory covering 3 CVEs |
before 4.18.2-1.1 | 4.18.2-1.1 |
python-pymongoopenSUSE:Leap 16.0 From an advisory covering 3 CVEs |
before 4.6.3-bp160.2.1 | 4.6.3-bp160.2.1 |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected | ||
| facts | OSV | |
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2026-96747 is a medium vulnerability (CVSS 5.3) in Mongodb Python Driver, published September 24, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.19%, the 8th percentile. Fixed in pymongo 4.18.2.
References
github.com/mongodb/mongo-python-driver/security/advisories/GHSA-qx36-8mw2-4r3x
github.com/mongodb/mongo-python-driver/releases/tag/4.18.2
github.com/mongodb/mongo-python-driver/blob/4.18.2/doc/changelog.rst
nvd.nist.gov/vuln/detail/CVE-2026-96747
github.com/mongodb/mongo-python-driver/pull/3066
github.com/mongodb/mongo-python-driver/commit/44119d0f9dfa0224d84b03be702a6d9a5ef1dea7
Show 16 moreShow less
github.com/mongodb/mongo-python-driver/commit/640dd2383a1a2fb1a10e5222d50ebc0b22a61bd7
mongodb.com/community/forums/t/pymongo-4-18-2-released/343732
github.com/advisories/GHSA-qx36-8mw2-4r3x
github.com/CVEProject/cvelistV5/tree/main/cves/2026/96xxx/CVE-2026-96747.json
security-tracker.debian.org/tracker/CVE-2026-96747
github.com/mongodb/mongo-python-driver
pypi.org/project/pymongo
suse.com/support/update/announcement/2026/suse-su-20264398-1
bugzilla.suse.com/1282827
bugzilla.suse.com/1282844
bugzilla.suse.com/1282845
suse.com/security/cve/CVE-2026-96747
suse.com/security/cve/CVE-2026-96748
suse.com/security/cve/CVE-2026-96749
ubuntu.com/security/CVE-2026-96747
cve.org/CVERecord?id=CVE-2026-96747
Left out here: 12 versions. The JSON record has them.