A use-after-free vulnerability in PostgreSQL's pg_show_all_settings() function allows a database user to read memory contents. This occurs when loading a module during scanning of custom-variable placeholders, which the module replaces and frees. The issue affects PostgreSQL major versions 16 through 18, specifically versions before 16.16, 17.12, and 18.7. Versions prior to 16 are not affected. A fix is available in PostgreSQL 16.16, 17.12, and 18.7.