PostgreSQL generation memory reuse turns a large allocation into code execution
PostgreSQL 16, 17, and 18 before their November minor releases contain an integer-wraparound flaw in generation memory contexts. CVE-2026-116328 can let a database user execute code as the operating-system user that runs the database.
The prerequisite is a large allocation. The advisory describes freeing an allocation larger than 1 GB and then reusing its block for smaller chunks when the back-pointer offset cannot represent the larger position. That is a memory-management defect inside the server, not an SQL injection or a weak password issue.
Affected and fixed releases
Major version 18 is affected before 18.7, version 17 before 17.12, and version 16 before 16.16. Versions before PostgreSQL 16 are unaffected. PostgreSQL published the fixes on November 12, 2026. The CVSS v3.1 score is 8.8 with a network attack vector, low complexity, and authenticated low privileges.
A database user does not normally receive operating-system code execution. When a memory-safety bug creates that path, database roles become a security boundary. Shared application roles, broad extension-install rights, and users who can invoke untrusted code deserve specific review.
Why ordinary restart checks are insufficient
A successful exploit may leave no clean crash record. The vulnerable path is associated with memory reuse and can depend on workload and allocation size. Teams should patch before attempting to reproduce the condition on production data.
After the update, verify the active server binary and the client tools used for maintenance. PostgreSQL minor releases are cumulative, and the project states that a dump and reload or pg_upgrade is not required for this minor update. That does not remove the need for normal backup and rollback planning.
Review the authority attached to database roles
Inventory roles that can create objects, extensions, functions, procedural-language code, or large temporary structures. Compare those grants with the application's actual needs. Split administrative roles from runtime application accounts and remove dormant superuser access.
Review large-memory workloads for anomalous failures or abrupt backend exits after the patch. Keep logs long enough to compare behavior. Do not use the flaw as a reason to collect SQL text containing credentials or customer data.
If compromise is suspected, involve the database and host incident teams together. Rotate credentials available to the affected database role and inspect operating-system process activity, not only SQL audit logs.
Verification checklist
- Confirm the server and relevant client binaries are at fixed minor versions.
- Identify database users with elevated object or extension authority.
- Verify backups and restoration tests precede the patch window.
- Review backend exits and memory-related errors after deployment.
- Rotate credentials if suspicious code execution or role misuse is found.
Top comments (0)