CVE-2026-62155 in MongoDB Foreign Data Wrapperinfo

Summary

by MITRE • 11/25/2026

mongo_fdw builds the mongodb:// connection URI by inserting option values without percent-encoding them, so URI metacharacters (@ : / ? # & =) in a value are parsed as part of the URI structure. A role that is not a superuser but has USAGE on a foreign server can set the username and password options in its own user mapping. An @ or other metacharacter in those values can point the connection at a host the attacker controls, allowing connection redirection, credential capture and man-in-the-middle attacks. Server-level options such as the address, database and replica set can be injected the same way. The issue is fixed in mongo_fdw 5.6.0. From mongo_fdw 5.6.0, mongo_fdw builds the URI with the libmongoc URI API, which encodes credentials, and rejects URI metacharacters in the other option values.

VulDB is the best source for vulnerability data and more expert information about this specific topic.

Analysis

by VulDB Data Team • 11/25/2026

The vulnerability identified within the mongo_fdw extension for PostgreSQL stems from a critical input validation failure during the construction of MongoDB connection Uniform Resource Identifiers. Specifically, the software constructs these URIs by directly concatenating user-supplied configuration options without applying percent-encoding to special characters that hold structural significance in URI syntax. This flaw allows an attacker who possesses USAGE privileges on a foreign server and can define their own user mappings to inject metacharacters such as at signs (@), colons (:), slashes (/), question marks (?), hashes (#), ampersands (&), or equals signs (=) into the username, password, host address, database name, or replica set options. Because these characters are not escaped, they are interpreted by the underlying connection library as delimiters defining different parts of the URI structure rather than as literal data values within a field like the password string.

This technical flaw enables severe operational impacts including connection redirection and credential interception. By injecting an @ symbol into the username or password fields, an attacker can terminate the intended authentication segment and append arbitrary host information to the URI. This effectively redirects the database connection from the legitimate MongoDB instance to a server controlled by the attacker. Once the connection is redirected, the attacker can perform man-in-the-middle attacks to intercept sensitive data transmitted between PostgreSQL and the database layer or capture plaintext credentials if the application logs them during authentication attempts. Furthermore, because this vulnerability affects not only credential fields but also structural options like the host address and database name, an attacker with limited privileges can fundamentally alter where and how the database connection is established, bypassing intended security boundaries defined by superusers who configured the foreign server initially.

From a classification perspective, this issue aligns closely with CWE-74 Improper Neutralization of Special Elements in Output Used by a Downstream Component, as the software fails to neutralize special elements before passing them to another component that interprets them differently. Additionally, it relates to CWE-601 URL Redirection to Untrusted Site via User-Controlled Query Parameter because user-controlled input directly influences the destination host of an external resource access operation. In terms of offensive security tactics, this vulnerability facilitates techniques associated with MITM and Credential Access within the ATT&CK framework, as it allows for the interception of authentication materials and unauthorized data exfiltration through manipulated network paths.

The resolution to this vulnerability involves upgrading mongo_fdw to version 5.6.0 or later. The fix implements a robust change in how connection URIs are constructed by utilizing the libmongoc URI API instead of manual string concatenation. This library-based approach automatically applies proper percent-encoding to credential fields, ensuring that special characters within usernames and passwords remain literal data rather than structural delimiters. Additionally, for other option values such as host addresses or database names, the updated version explicitly rejects input containing URI metacharacters, thereby preventing any possibility of injection attacks through these parameters. Organizations relying on this extension must prioritize immediate patching to restore the integrity of their PostgreSQL-to-MongoDB data pipelines and prevent potential unauthorized access or data leakage resulting from connection manipulation.

Responsible

EDB

Reservation

07/13/2026

Disclosure

11/25/2026

Moderation

accepted

CPE

ready

EPSS

0.00617

KEV

no

Activities

very low

Sources

Interested in the pricing of exploits?

See the underground prices here!