# CVE-2026-62157: mongo_fdw out-of-bounds read when building an ObjectId from short _id values

- Severity: Medium 5.3 (CVSS:4.0, scored by EDB) `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`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.62%, higher than 51% of CVEs (2026-12-01)
- Published: 2026-11-25T16:36:24.037Z
- Modified: 2026-11-25T20:16:05.627Z
- Weaknesses: CWE-125
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: EDB

## Description

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. The issue is fixed in mongo_fdw 5.6.0. From mongo_fdw 5.6.0, mongo_fdw accepts only valid 24-character hexadecimal ObjectIds and 12-byte bytea values.

(As written by CVE List.)

## Affected

- EnterpriseDB MongoDB Foreign Data Wrapper (mongo_fdw): before 5.6.0

## References

- <https://www.enterprisedb.com/docs/security/advisories/cve202662157/> (vendor-advisory)
- <https://github.com/EnterpriseDB/mongo_fdw/releases/tag/REL-5_6_0> (patch, release-notes)

## Sources

- CVE List: [CVE-2026-62157](https://www.cve.org/CVERecord?id=CVE-2026-62157), CVE Terms of Use, modified 2026-11-25
- NVD: [CVE-2026-62157](https://nvd.nist.gov/vuln/detail/CVE-2026-62157), Public domain, modified 2026-11-25

---

Page: https://cve.day/CVE-2026-62157 · Whole record: https://cve.day/CVE-2026-62157.json · Rebuilt by cve.day 2026-11-25T23:18:16.790Z
