CVE-2026-96748: PyMongo connection string parsing host injection

CVE-2026-96748 · Severity: medium · CVSS 6.5 · Published 2026-09-24

PyMongo, a MongoDB database driver for Python, improperly decodes percent-encoded characters in connection strings before parsing the host list. An attacker who can control a hostname value supplied to an application can inject additional MongoDB servers into the client's connection, allowing them to intercept authentication credentials and database operations. This could enable account takeover or data exposure.

Technologies: pymongo (PyPI). Vendors: MongoDB, PyPI.

Quick answers

Is CVE-2026-96748 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-96748 being exploited in the wild.
How severe is CVE-2026-96748?
Medium severity, with a CVSS score of 6.5, published 24 September 2026.
Which products and versions are affected?
MongoDB PyMongo before 4.18.2; pymongo (PyPI) >= 3.5.0, <= 4.18.1, ECOSYSTEM:introduced=3.5.0,fixed=4.18.2.
Is there a fix for CVE-2026-96748?
Yes. pymongo (PyPI): upgrade to 4.18.2 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-96748 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2026-96748?
Check whether you run MongoDB PyMongo or pymongo (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • pymongo (PyPI): upgrade to 4.18.2 or later
    pip install "pymongo>=4.18.2"

Technical details

The vulnerability exists in PyMongo's connection string parsing logic, which decodes percent-encoded characters in the hostname portion before splitting on delimiters. An unauthenticated attacker can craft a hostname that, when decoded, contains delimiters (commas) that trick the parser into adding attacker-controlled servers to the host list. The attacker's server receives the authentication exchange and database queries, observing limited information and potentially returning modified results.

Affected products

  • MongoDB PyMongo before 4.18.2

Identifiers

  • CVE-2026-96748
  • GHSA-vp6j-j7w5-5xjj
  • PYSEC-2026-4297

Timeline

  • 2026-09-24: disclosed

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.