PyMongo shipped one release that closes two high-severity advisories.
- PyMongo 4.18.2 fixes a host injection in connection strings and a BSON size overflow.
Security
PyMongo 4.18.2 closes a host injection and a BSON size overflow
GitHub’s advisory for CVE-2026-96748, published on 5 October and rated high, says PyMongo 3.5.0 through 4.18.1 percent-decoded the whole host section of a connection string before splitting it. A percent-encoded comma or colon in a hostname therefore became a real delimiter, and the advisory says an attacker could add a host and port of their choosing to the client’s seed list. Unix domain socket paths are not affected, the advisory says. A second advisory, CVE-2026-96749, also rated high, covers PyMongo before 4.18.2. It says a signed 32-bit size overflow in the bundled native BSON encoder can, depending on how the extension was built, write outside an allocated buffer when one document is built from an unusually large amount of caller-supplied data. Both advisories list 4.18.2 as the fix.
This week. Upgrade PyMongo to 4.18.2. Until that upgrade, do not place untrusted input in the host portion of a MongoDB connection string.
Leave a Reply