A type confusion vulnerability in PostgreSQL materialized set-returning functions allows a database user to execute arbitrary code with the privileges of the operating system user running the database. The issue arises when returning rows with different dynamic RECORD return types. The json_populate_recordset() function is among those affected. Versions prior to PostgreSQL 14.25, 15.20, 16.16, 17.12, and 18.7 are vulnerable.