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

Published Nov 25, 2026
·
Updated

mongofdw 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 mongofdw 5.6.0. From mongofdw 5.6.0, mongofdw accepts only valid 24-character hexadecimal ObjectIds and 12-byte bytea values.

Affected Software

1 affected component
EnterpriseDB mongo_fdw<5.6.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade mongo_fdw to a version that resolves this vulnerability.

    Fixed in 5.6.0

Event History

Nov 25, 2026
CVE Published
via MITRE·04:36 PM
Data Sourced
via MITRE·04:36 PM
DescriptionWeakness

Frequently Asked Questions

1

Who can trigger this issue?

Any user who can supply an _id value or a predicate on a mongo_fdw foreign table can trigger the out-of-bounds read. This can crash the PostgreSQL backend or cause adjacent memory to be included in a query sent to MongoDB.

2

What input values are unsafe in affected versions?

Bytea _id values shorter than 12 bytes are unsafe. Name-typed values and JSON $oid fields shorter than 24 characters are also unsafe because the conversion reads a fixed-length ObjectId input without validating its length.

3

Are default deployments affected?

The issue applies where users can provide _id values or predicates against mongo_fdw foreign tables. The provided information does not establish whether such access is available in a default deployment.

4

What changes in the fixed release?

mongo_fdw 5.6.0 fixes the issue by accepting only valid 24-character hexadecimal ObjectIds and 12-byte bytea values.

5

What can be done before upgrading?

Restrict untrusted users from supplying _id values or predicates on mongo_fdw foreign tables, and reject short bytea, name-typed, and JSON $oid inputs before they reach mongo_fdw.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203