PostgreSQL: A 22-year-old data type handling bug allows code execution on the server
Attack Techniques & Methods2026-11-13, 11:18
PostgreSQL: A 22-year-old data type handling bug allows code execution on the server
Researcher Mehmet Ince discovered a critical vulnerability CVE-2026-6460 in PostgreSQL, rated CVSS 8.8. The vulnerability has been present in PostgreSQL's architecture since 2004 and affects the database core, including cloud deployments. Exploitation requires only an account that can create objects in the database; superuser privileges are not needed.
The researcher demonstrated an attack using prepared SQL queries (Prepared Statements). First, he created a composite type with a
UUID field and saved the query using PREPARE. He then used ALTER TYPE to change the field type to bytea and executed the previously prepared query using EXECUTE. PostgreSQL used the value's old binary representation but processed it as the new data type, resulting in the incorrect interpretation of pointers and memory corruption. Based on this, the researcher developed memory read and write primitives, as well as a method for disclosing addresses to bypass ASLR, and then demonstrated arbitrary code execution on PostgreSQL 18.6.Exploiting the vulnerability allows an attacker to escape the privileges granted to them in the database and execute arbitrary code with the privileges of the PostgreSQL system user. This enables the attacker to read other users' confidential data, access server files and secrets, and further compromise the infrastructure.