CVE-2025-11695: MongoDB Rust Driver has certificate validation disabled when `tlsInsecure=False` appears in connection string
8
Basic Information
Technical Details
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| mongodb | rust | < 3.2.5 | 3.2.5 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability exists in the MongoDB Rust driver's connection string parsing logic. Specifically, the code that handles the tlsInsecure option contained a logical flaw. When a user specified tlsInsecure=false in the connection URI, the driver would incorrectly interpret this as a request to disable TLS certificate validation. This is because the boolean value of the parameter was inverted before being applied to the allow_invalid_certificates setting.
The root cause is in the ConnectionString::parse method (and its internal helper parse_option_pair in older versions), located in src/client/options.rs. The patch corrects this by directly using the boolean value of tlsInsecure to configure allow_invalid_certificates and allow_invalid_hostnames, ensuring that tlsInsecure=false correctly enables certificate validation as intended.
The function ClientOptions::parse is the public-facing API that developers would use, which in turn calls the vulnerable parsing logic, making it a key indicator in a runtime profile during the establishment of a database connection.
Vulnerable functions
mongodb::client::options::ConnectionString::parsesrc/client/options.rs
mongodb::client::options::ClientOptions::parsesrc/client/options.rs