Vulnérabilité dans pymongo (CVE-2026-96748)
Résumé
Vulnérabilité dans pymongo (CVE-2026-96748). Les données peuvent être altérées par des attaquants. Exploitable via split_hosts. Atténuation : mise à jour vers 4.18.2 ou plus.
Description d'origine
La description telle que publiée par la source (souvent en anglais).
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
Résumé généré automatiquement
Assemblé par SecPulse à partir des données sources (CVSS, CWE, versions affectées) à l'aide de modèles, sans IA. Vérifiez la description d'origine et les références ci-dessous.
Une vulnérabilité référencée CVE-2026-96748 a été découverte dans pymongo.
Des attaquants peuvent cibler un point d'entrée spécifique comme split_hosts à distance pour détourner le produit.
Les données peuvent être altérées par des attaquants. Score CVSS : 6.5/10.
Action : mettez à jour pymongo vers 4.18.2 ou supérieur.
En cas de doute, contactez votre service informatique ou cherchez « pymongo CVE-2026-96748 » sur le site de l'éditeur.
CVE-2026-96748 (pymongo) — CWE-177 / CVSS v3 6.5
Vecteur d'attaque : distant (réseau) / non authentifié / sans interaction utilisateur
Surface d'attaque : split_hosts / unquote_plus / _validate_uri / _parse_srv
Correctif : 4.18.2 — appliquer immédiatement
Contournement : Do not interpolate untrusted input into the host portion of a connection string.
Plan : 1) Audit SBOM, 2) Mise à jour staging→prod, 3) Surveillance WAF/proxy sur les endpoints affectés, 4) Recherche d'IOC dans les logs.
Réfs : voir GHSA / avis éditeur / version corrigée liés sur cette page.
Une vulnérabilité (CWE-177) affecte pymongo. Les attaquants atteignent le code vulnérable via split_hosts sans authentification.
Consultez l'avis de l'éditeur pour les versions affectées de pymongo. Surface d'attaque : split_hosts / unquote_plus / _validate_uri / _parse_srv.
Gravité : Moyenne (CVSS 6.5/10). Les données peuvent être altérées par des attaquants.
Mettre à jour vers 4.18.2.
Contournement : Do not interpolate untrusted input into the host portion of a connection string.
Recherchez dans les logs des requêtes correspondant aux IOC connus de cette CVE. Auditez les SBOM/dépendances.
Actions de réponse
Étapes concrètes et exemples de commandes que les équipes SOC/SRE doivent exécuter dans l'ordre
-
1Identify exposure identify
grep -r 'pymongo' . | grep -v node_modulesリポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で
pymongoを grep し、稼働しているサービス・バージョンを把握する。 -
2Apply 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. を実施。回避策の副作用 (機能低下) を確認した上で。
-
3Apply patch patch
Upgrade pymongo to 4.18.2ステージング環境で 4.18.2 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。
-
4Post-deployment verification verify
Confirm patched version is live in productionパッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。
Paquets affectés
Références
- web github.com
- web github.com
- web github.com
- web nvd.nist.gov
- web github.com
- web github.com
- web github.com
- web mongodb.com
- web github.com