A heap-based buffer overflow vulnerability exists in PostgreSQL foreign batch inserts, allowing a foreign server to execute arbitrary code by reporting that it inserted more rows than actually supplied. This affects PostgreSQL versions prior to 18.7, 17.12, 16.16, 15.20, and 14.25.