Heap buffer overflow in PostgreSQL pg_stat_statements allows the query author to execute arbitrary code as the operating system user running the database, via crafted queries containing array constants. Within major version 18, minor versions before PostgreSQL 18.6 are affected. Versions before PostgreSQL 18 are unaffected.
Credits
The PostgreSQL project thanks Sajeeb Lohani (with TrendAI Zero Day Initiative), Yuelin Wang, and David Korczynski (Claude and Ada Logics) for reporting this problem.