A use-after-free vulnerability in the PostgreSQL dblink extension allows an object creator to execute arbitrary code with the privileges of the database operating system user. This occurs due to type conversion code that re-enters dblink and closes a connection while an outer dblink call is still reading its results. Versions before PostgreSQL 14.25, 15.20, 16.16, 17.12, and 18.7 are affected.