highCVSS 6.5Vulnerability

CVE-2026-96748

### Summary PyMongo percent-decoded the entire host section of a connection string before splitting it into individual `host:port` entries. A percent-encoded `,` or `:` in a hostname therefore decoded into a real delimiter, injecting an additional attacker-chosen host and port into the client's seed list. ### Impact An application that interpolates untrusted input into a MongoDB connection string -- for example, a tenant name or hostname fragment taken from a request -- could be made to add an attacker-controlled server to the seed list. Because `%2C` and `%3A` survive most URL-safety checks and only become delimiters inside PyMongo's parser, input that looks like a single hostname to the application becomes two hosts to the driver. The client may then perform topology discovery and authentication against the attacker's host, exposing credentials, or route operations to it. Unix domain socket paths, the only host identifiers that legitimately require percent-encoding, are not affected. ### Patches Fixed in PyMongo 4.18.2. Percent-decoding was moved into `split_hosts` and now applies only to Unix domain socket paths, identified by an unescaped `.sock` suffix before decoding, and only after splitting on `,`. ### Workarounds Do not interpolate untrusted input into the host portion of a connection string. If unavoidable, reject or percent-decode-and-validate the value before building the URI. ### Details The decoding was introduced in PyMongo 3.5.0 (PYTHON-1282), where `unquote_plus` was applied to the whole host section in `_validate_uri` and, later, `_parse_srv`, before the string was split on `,` and `:`.

Properties

severity
high
summary
PyMongo: PYTHON-5986 Host injection in PyMongo connection string parsing via percent-encoded delimiters
epss_score
0.00257
cvss_score
6.5
retrieved_at
2026-10-06T03:06:48+00:00
ghsa_published
2026-10-05T23:47:07Z
source_url
https://github.com/advisories/GHSA-vp6j-j7w5-5xjj
ghsa_updated
2026-10-05T23:47:09Z
ghsa_id
GHSA-vp6j-j7w5-5xjj
last_source
FIRST EPSS
cve_id
CVE-2026-96748
cvss_vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:H/A:N
signal_observed_at
2026-10-06T02:58:31+00:00
is_ghsa_only
false
epss_percentile
0.15782

Related Entities (5)

ENRICHED_BY (1)

→[Source]FIRST EPSS

VULNERABLE_TO (1)

←[Software]pip/pymongo

AFFECTS (1)

→[Software]pip/pymongo

HAS_WEAKNESS (1)

→[Weakness]Improper Handling of URL Encoding (Hex Encoding)

REPORTED_BY (1)

→[Source]GitHub Advisory Database

Explore deeper with Ninja Signal's threat intelligence graph

CVE-2026-96748 (CVSS 6.5) — Ninja Signal Threat Intelligence | Ninja Signal