# CVE-2026-120149: PostgreSQL heap buffer overflow in foreign batch inserts

Source: https://junglewise.ai/threats/cve-2026-120149-heap-based-buffer-overflow-in-postgresql-foreign-batch-inserts  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-11-12. Updated: 2026-11-12  
License: CC BY 4.0 with a link back

CVE-2026-120149 · Severity: high · CVSS 8.8 · Published 2026-11-12

PostgreSQL is an open-source database system widely used to store and query business-critical data. A heap buffer overflow in its foreign data wrapper (FDW) batch insert feature allows a malicious remote database server to execute arbitrary code on the PostgreSQL server. This could lead to complete compromise of the database and any data it holds.

Technologies: [PostgreSQL](https://junglewise.ai/threats/technologies/postgresql). Vendors: [PostgreSQL](https://junglewise.ai/threats/vendors/postgresql).

## Quick answers

**Is CVE-2026-120149 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-120149 being exploited in the wild.

**How severe is CVE-2026-120149?** High severity, with a CVSS score of 8.8, published 12 November 2026.

**Which products and versions are affected?** PostgreSQL before 18.7, 17.12, 16.16, 15.20, and 14.25.

**Is there a fix for CVE-2026-120149?** Yes: fixed in PostgreSQL 18.7, 17.12, 16.16, 15.20, 14.25. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-120149 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-120149?** Check whether you run PostgreSQL at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- Fixed in PostgreSQL 18.7, 17.12, 16.16, 15.20, 14.25

## Technical details

A heap-based buffer overflow occurs in postgres_fdw when a remote server reports inserting more rows than the client actually supplied during a batch insert operation. The vulnerability is triggered when remote table rules expand an INSERT into additional rows, causing a buffer overrun. An attacker controlling a remote server accessed via FDW can exploit this to achieve remote code execution with the privileges of the PostgreSQL process.

## Affected products

- PostgreSQL PostgreSQL before 18.7, 17.12, 16.16, 15.20, and 14.25

## Timeline

- 2026-11-12: disclosed
- 2026-11-12: patched

## References

- [https://www.postgresql.org/support/security/CVE-2026-120149/](https://www.postgresql.org/support/security/CVE-2026-120149/)

## Related threats

- [PostgreSQL CREATE EXTENSION arbitrary SQL execution](https://junglewise.ai/threats/cve-2026-6467-uncontrolled-search-path-element-in-postgresql-create-extension)
- [PostgreSQL type confusion in ALTER allows arbitrary code execution](https://junglewise.ai/threats/cve-2026-6460-type-confusion-in-postgresql-allows-an-object-creator-to-execute)
- [PostgreSQL type confusion in SQL-language functions arbitrary code execution](https://junglewise.ai/threats/cve-2026-18447-type-confusion-in-postgresql-sql-language-functions-allows-an)
- [PostgreSQL INSERT ON CONFLICT authorization bypass on auto-updatable views](https://junglewise.ai/threats/cve-2026-16237-improper-protection-in-postgresql-insert-on-conflict-on-auto)
- [PostgreSQL dblink and subscriptions arbitrary file append](https://junglewise.ai/threats/cve-2026-14661-external-control-of-file-name-in-postgresql-dblink-and-create)
