Categories
CVE-2026-96748 medium CVSS 6.5

Vulnerability in pymongo (CVE-2026-96748)

Summary

Vulnerability in pymongo (CVE-2026-96748). Data can be tampered with by attackers. Exploitable via split_hosts. Mitigation: upgrade to 4.18.2 or later.

Original description

The description as published by the source.

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…

Source: NIST National Vulnerability Database NVD GitHub Advisory

Auto-generated summary

Assembled by SecPulse from the source data (CVSS, CWE, affected versions) using templates — no AI involved. Check the original description and references below for exact details.

A vulnerability tracked as CVE-2026-96748 has been found in pymongo.
Attackers can target a specific entry point like split_hosts over the network to misuse the product.
Data can be tampered with by attackers. CVSS score: 6.5/10.
What to do: upgrade pymongo to 4.18.2 or later.
If unsure, ask your IT team or search "pymongo CVE-2026-96748" on the vendor's site.

CVE-2026-96748 (pymongo) — CWE-177 / CVSS v3 6.5
Attack vector: remote (network-reachable) / unauthenticated / no user interaction
Attack surface: split_hosts / unquote_plus / _validate_uri / _parse_srv
Patched: 4.18.2 — apply immediately
Workaround: Do not interpolate untrusted input into the host portion of a connection string.
Plan: 1) Audit SBOM/dependencies, 2) Stage→prod upgrade, 3) Add WAF/proxy monitoring on affected endpoints, 4) Hunt IOCs in logs.
Refs: see the GHSA / vendor advisory / patched release linked on this page.

❓ What is the problem

A vulnerability (CWE-177) exists in pymongo. Attackers reach the vulnerable code path via split_hosts without authentication.

📍 Affected scope

Check the vendor advisory for the affected versions of pymongo. Attack surface: split_hosts / unquote_plus / _validate_uri / _parse_srv.

🔥 Severity

Severity: Medium (CVSS 6.5/10). Data can be tampered with by attackers.

🔧 How to fix

Update to 4.18.2.

🛡️ Workaround

Workaround: Do not interpolate untrusted input into the host portion of a connection string.

🔍 Detection

Search webserver/proxy logs for unusual request patterns matching this CVE's known IOCs. Run grep -r 'pymongo' . against your dependency files (package-lock.json, requirements.txt, go.sum) to find affected services.

Response actions

Concrete steps and command examples for SOC/SRE teams to execute in order

  1. 1
    Identify exposure identify
    grep -r 'pymongo' . | grep -v node_modules

    リポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で pymongo を grep し、稼働しているサービス・バージョンを把握する。

  2. 2
    Apply temporary workaround mitigate
    Do not interpolate untrusted input into the host portion of a connection string.

    パッチが適用されるまでの応急処置として、Do not interpolate untrusted input into the host portion of a connection string. を実施。回避策の副作用 (機能低下) を確認した上で。

  3. 3
    Apply patch patch
    Upgrade pymongo to 4.18.2

    ステージング環境で 4.18.2 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。

  4. 4
    Post-deployment verification verify
    Confirm patched version is live in production

    パッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。

Affected packages

pip pymongo
[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"4.18.2"}]}]

References

We use cookies for analytics and ad measurement. This setting applies to all Game co., Ltd. sites. Details