MONGODB · CVE-2026-126837 · Package
FIX → 7.8.0 ✓ verified
The MongoDB Node.js driver checks SRV host names against the connection string domain, but certain characters let a crafted name escape that check, so the driver builds the connection address from the original name and dials the wrong host. An attacker who can forge or change DNS SRV responses can send the app's data, credentials and queries to a server of their choice.
first public Nov 12, 2026 · 2 sources
Check it with your coding agent
It reads this page and tells you if your code or app is affected.
Applications using the MongoDB Node.js driver with mongodb+srv:// connection strings, which resolve hosts through DNS SRV lookups. Applications that use only mongodb:// connection strings are stated not to be affected. Exposure also depends on whether an attacker can forge or alter DNS responses on the path the application uses.
Not affected if mongodb-connection-string-only, no-srv-lookups
Who cares dns, mongodb, mongodb+srv, node.js, npm
npm ls mongodb (also check lock files and transitive copies, e.g. via mongoose). Versions 3.3.3 through 7.7.x are affected; 7.8.0 is fixed.mongodb+srv:// in code, env vars and config. Apps using only mongodb:// are not affected.A validation flaw in the DNS SRV host discovery of the MongoDB Node.js driver may cause the driver to connect to a host outside the expected domain. For a mongodb+srv:// connection string, the driver checks each host name in the DNS SRV response against the domain of the connection string. The driver then builds the connection address from the original name, in which certain characters end the host name early. An unauthenticated party who can forge or change the DNS SRV response may redirect the connection to a host of their choice. TLS does not prevent this, because the driver verifies the server certificate against the redirected host name. This may result in unintended disclosure of application data and authentication credentials, and in altered query results. Applications that use mongodb:// connection strings are not affected.
Are you affected?
Ask from here. InfraStack checks the affected versions against your stack and answers in your inbox.
InfraStack checks the affected versions against your stack and answers in Slack, with the evidence and the fix.
InfraStack checks it against your stack and answers on your report, with the evidence and the fix.
Upgrade to 7.8.0
7.8.0 or later6.22.0 release notes do not mention the SRV issue7.8.0) to pin the allowed host-name suffixThis page as .md · .json · CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
NVD data is provided by NIST and is public domain. Posts quoted belong to their authors.