A use-after-free vulnerability in the PostgreSQL plperl procedural language allows an attacker with object creation privileges to execute arbitrary code with the database server's operating system user privileges. This occurs via reentrant calls to the return_next() function. Versions prior to PostgreSQL 14.25, 15.20, 16.16, 17.12, and 18.7 are affected.