Mongodb Foreign Data Wrapper Mongo Fdw
Monthly
An out-of-bounds read in mongo_fdw, EnterpriseDB's PostgreSQL foreign data wrapper for MongoDB, allows an authenticated user with access to a MongoDB foreign table to supply a short _id value that libbson reads past the end of its input buffer. The flaw can crash the PostgreSQL backend or leak adjacent process memory into the query sent to MongoDB, but the assessed impact is limited to low confidentiality and availability effects rather than code execution or data modification. No public exploit has been identified at time of analysis; mongo_fdw 5.6.0 is the vendor-released fix that restricts accepted values to valid 24-character hexadecimal ObjectIds and 12-byte bytea values.
mongo_fdw builds its mongodb:// connection URI by splicing option values in without percent-encoding, so a value containing URI metacharacters such as @ : / ? # & = is reinterpreted as URI structure and can redirect the connection to an attacker-controlled host, capturing credentials or enabling man-in-the-middle. Only roles that are not superusers but hold USAGE on a mongo_fdw foreign server - and can set the username/password options in their own user mapping, or server-level options such as address, database and replica set where they are permitted to do so - can trigger this, making it an authenticated, privilege-gated injection (CWE-74) rather than an anonymous path. The flaw is fixed in mongo_fdw 5.6.0, which builds the URI through the libmongoc URI API and rejects metacharacters in non-credential options; no public exploit code or confirmed active exploitation was identified at time of analysis.
An out-of-bounds read in mongo_fdw, EnterpriseDB's PostgreSQL foreign data wrapper for MongoDB, allows an authenticated user with access to a MongoDB foreign table to supply a short _id value that libbson reads past the end of its input buffer. The flaw can crash the PostgreSQL backend or leak adjacent process memory into the query sent to MongoDB, but the assessed impact is limited to low confidentiality and availability effects rather than code execution or data modification. No public exploit has been identified at time of analysis; mongo_fdw 5.6.0 is the vendor-released fix that restricts accepted values to valid 24-character hexadecimal ObjectIds and 12-byte bytea values.
mongo_fdw builds its mongodb:// connection URI by splicing option values in without percent-encoding, so a value containing URI metacharacters such as @ : / ? # & = is reinterpreted as URI structure and can redirect the connection to an attacker-controlled host, capturing credentials or enabling man-in-the-middle. Only roles that are not superusers but hold USAGE on a mongo_fdw foreign server - and can set the username/password options in their own user mapping, or server-level options such as address, database and replica set where they are permitted to do so - can trigger this, making it an authenticated, privilege-gated injection (CWE-74) rather than an anonymous path. The flaw is fixed in mongo_fdw 5.6.0, which builds the URI through the libmongoc URI API and rejects metacharacters in non-credential options; no public exploit code or confirmed active exploitation was identified at time of analysis.