First Published: 2026/11/25
Last Updated: 2026/11/25
Summary
mongo_fdw converts _id values to 12-byte MongoDB ObjectIds with libbson functions that read a fixed number of bytes without checking the input length: 12 bytes for a bytea _id, and 24 characters for name-typed values and $oid fields in JSON. A shorter value causes a read past the end of the input, which can crash the PostgreSQL backend or include adjacent memory in the query sent to MongoDB. Any user who can supply an _id value or predicate on a foreign table can trigger it.
Vulnerability details
CVE-ID: CVE-2026-62157
CVSS Base Score: 5.3 Medium
CVSS Temporal Score: Undefined
CVSS Environmental Score: Undefined
CVSS Vector: CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:L/VI:N/VA:L/SC:N/SI:N/SA:N
Affected products and versions
- Affected Product: MongoDB Foreign Data Wrapper (mongo_fdw)
- Affected Versions: mongo_fdw 5.5.3 and earlier, on all supported PostgreSQL and EDB Postgres Advanced Server versions
Remediation/fixes
Impacted users must upgrade to mongo_fdw 5.6.0 or later. From mongo_fdw 5.6.0, mongo_fdw accepts only valid 24-character hexadecimal ObjectIds and 12-byte bytea values.
| Product | VRMF | Remediation/First Fix |
|---|---|---|
| mongo_fdw | 5.5.3 and earlier | Update to mongo_fdw 5.6.0 or later |
Mitigation
Until you can upgrade, reduce exposure as follows:
- Grant access to mongo_fdw foreign tables only to trusted roles.
References
Related information
Acknowledgement
Source: Discovered internally by EDB during a security review of mongo_fdw.
Change history
- 2026/11/25: Original Copy Published
Disclaimer
This document is provided on an "as is" basis and does not imply any kind of guarantee or warranty, including the warranties of merchantability or fitness for a particular use. Your use of the information on the document is at your own risk. EDB reserves the right to change or update this document at any time. Customers are therefore recommended to always view the latest version of this document.