A type confusion vulnerability in PostgreSQL extended statistics allows an attacker who can create objects to execute arbitrary code with the privileges of the database operating system user. This occurs via a statistics expression using an anonymous RECORD type whose backend-local type identifier mismatches a different row type in another session. Versions before PostgreSQL 14.25, 15.20, 16.16, 17.12, and 18.7 are affected.