Description
PyMongo's connection string parsing decodes percent-encoded characters in the host portion before the host list is separated on its delimiters. When an application places a hostname value supplied by an unauthenticated party into a connection string, that party may cause additional servers of their choosing to be added to the application's database client. The application may then send its authentication exchange and database operations to one of those servers, which can observe limited information and return altered results.
Published: 2026-09-24
Score: 8.3 High
EPSS: < 1% Very Low
KEV: No
Impact: Potential for unauthorized data manipulation and altered query results via injected host redirects.
Action: Immediate Patch
AI Analysis

Impact

The flaw exists because PyMongo decodes percent‑encoded characters in the host portion of a connection string before it splits the host list on its delimiters. When an application inserts a hostname that an unauthenticated party can influence into the connection string, the driver may add additional, attacker‑controlled servers to its database client. As the client initializes authentication and sends database operations, those rogue servers can observe limited request data and return crafted responses, allowing an attacker to alter query results or glean sensitive information. This enables unauthorized data manipulation and potential data leakage.

Affected Systems

MongoDB’s official Python driver, PyMongo, is impacted when it processes host values containing percent‑encoded delimiters prior to host splitting. All driver releases issued before the 4.18.2 update are vulnerable; the 4.18.2 release onward includes the vendor patch that prevents the premature decoding of host strings.

Risk and Exploitability

The CVSS score of 8.3 marks this vulnerability as high severity. The EPSS score of 0.00257 (< 1%) indicates a very low probability of exploitation, and it is not listed in the CISA KEV catalog. The flaw can be exploited remotely if an attacker can supply a hostname into application configuration or user‑generated data. In such scenarios the attack vector is likely HTTP or configuration‑based injection, with the attacker able to redirect the database client to a malicious server.

Generated by OpenCVE AI on September 26, 2026 at 01:28 UTC.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade the MongoDB Python driver to version 4.18.2 or later, which contains the official vendor patch.
  • Review all application code and configuration that generates or accepts hostname values intended for the driver, and enforce that only trusted, static hostnames are used.
  • Validate or sanitize hostnames before building the connection string by stripping or prohibiting percent‑encoded delimiters.
  • Where possible, block network traffic to untrusted servers through firewall or application layer rules to prevent unintended redirection.

Generated by OpenCVE AI on September 26, 2026 at 01:28 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-vp6j-j7w5-5xjj PyMongo: PYTHON-5986 Host injection in PyMongo connection string parsing via percent-encoded delimiters
History

Fri, 25 Sep 2026 12:15:00 +0000

Type Values Removed Values Added
Weaknesses CWE-140
References
Metrics threat_severity

None

threat_severity

Moderate


Fri, 25 Sep 2026 08:15:00 +0000

Type Values Removed Values Added
First Time appeared Mongodb
Mongodb python Driver
Vendors & Products Mongodb
Mongodb python Driver

Thu, 24 Sep 2026 19:30:00 +0000

Type Values Removed Values Added
References
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Thu, 24 Sep 2026 18:30:00 +0000

Type Values Removed Values Added
Description PyMongo's connection string parsing decodes percent-encoded characters in the host portion before the host list is separated on its delimiters. When an application places a hostname value supplied by an unauthenticated party into a connection string, that party may cause additional servers of their choosing to be added to the application's database client. The application may then send its authentication exchange and database operations to one of those servers, which can observe limited information and return altered results.
Title Connection redirection via percent-encoded delimiter injection in connection string hosts
Weaknesses CWE-177
References
Metrics cvssV3_1

{'score': 6.5, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:H/A:N'}

cvssV4_0

{'score': 8.3, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:H/VA:N/SC:N/SI:N/SA:N'}


Subscriptions

Mongodb Python Driver
cve-icon MITRE

Status: PUBLISHED

Assigner: mongodb

Published:

Updated: 2026-09-24T19:12:05.362Z

Reserved: 2026-09-23T15:45:50.867Z

Link: CVE-2026-96748

cve-icon Vulnrichment

Updated: 2026-09-24T18:36:33.745Z

cve-icon NVD

Status : Awaiting Analysis

Published: 2026-09-24T19:17:20.813

Modified: 2026-09-24T21:00:46.893

Link: CVE-2026-96748

cve-icon Redhat

Severity : Moderate

Publid Date: 2026-09-24T18:18:12Z

Links: CVE-2026-96748 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-09-26T01:30:13Z

Weaknesses
  • CWE-140

    Improper Neutralization of Delimiters

  • CWE-177

    Improper Handling of URL Encoding (Hex Encoding)