What happened
On 12 November 2026 the PostgreSQL Global Development Group released 18.7, 17.12, 16.16, 15.20 and 14.25. The release fixes 52 security flaws. The most discussed is CVE-2026-6460, rated CVSS 8.8.
According to the project's advisory, the bug is a type confusion in the server. PostgreSQL did not track typed values well enough, and values were not self-identifying. When a column or composite type is changed with ALTER ... SET DATA TYPE, stale values can remain in other parts of the server, such as data dictionary entries and PL/pgSQL variables. The server can then read an old value as if it had the new type. The advisory says this lets an object creator execute arbitrary code as the operating system user running the database. It also notes other DDL routes, for example repeated ALTER TABLE ... ADD COLUMN around a ROLLBACK.
All versions before 18.7, 17.12, 16.16, 15.20 and 14.25 are affected. The project has not reported attacks using the flaw, and the CISA assessment in the CVE record lists exploitation as none, according to reporting by The Hacker News. A researcher has published a technical write-up of a working exploit, so the window between patch and abuse may be short. We do not link exploit material here.
The same release also fixes client-side issues: a crafted archive can make pg_restore run code as the user running it, and a compromised source server can make psql run code through a pg_dump tar restore script.
Why it matters
Database servers sit close to the most valuable data and are often reachable from many application servers. Code execution as the postgres OS user means access to every database file, configuration, backup that the service account can read, and often a foothold for lateral movement.
The precondition matters. The attacker needs a database login that can create or modify objects. That is not an anonymous internet attacker, but it is a realistic outcome of SQL injection in an application whose role has DDL rights, a stolen application credential, or a compromised tenant on a shared database. Red Hat's assessment describes the requirement the same way. Public sources do not say whether an account with only default privileges can go beyond a crash to code execution, so treat any login as potentially relevant until you have patched.
Two details raise the cost of patching. First, C-language extensions built against older releases still load but may not be protected, so they must be rebuilt or updated with the server. Second, there is no workaround. The project warns against turning off the new composite_type_mismatch checks.
What defenders should check
- Inventory every instance: SELECT version(); and SELECT extname, extversion FROM pg_extension; Include containers, managed services and developer laptops.
- Compare each major version with the fixed release: 18.7, 17.12, 16.16, 15.20 or 14.25.
- PostgreSQL 14 is now end-of-life and 14.25 is its last release. Older major versions are affected and received no update, so they need an upgrade.
- Review which roles can create or alter objects: SELECT rolname, rolcreatedb, rolsuper FROM pg_roles; and check schema CREATE grants. Application roles at runtime rarely need DDL rights.
- If PostgreSQL runs outside its package's service unit, for example under Patroni, restart it explicitly after the update. Maintainers of the RPM packages recommend this.
- Update pg_dump, pg_restore, psql, reindexdb and vacuumdb on every machine that runs them.
- Check that port 5432 is not exposed to the internet, and that managed services have taken the provider's update.
Detection ideas
These are starting points to adapt and test in your environment. They are not production-ready rules.
PostgreSQL log review, assuming log_statement is set to ddl or higher and log_line_prefix includes the user:
grep -Ei "ALTER (TABLE|TYPE).*(SET DATA TYPE|ALTER COLUMN .* TYPE|ADD COLUMN)" /var/log/postgresql/postgresql-*.log
grep -E "server process .* was terminated by signal" /var/log/postgresql/postgresql-*.log
Repeated crashes of backend processes shortly after DDL from a non-administrative role deserve attention, because type confusion failures often show up as crashes before they are reliable.
Process lineage on Linux with Microsoft Defender for Endpoint (adapt field names to your EDR):
DeviceProcessEvents
| where InitiatingProcessFileName in~ ("postgres", "postmaster")
| where FileName in~ ("sh", "bash", "dash", "curl", "wget", "nc", "python3", "perl")
| project Timestamp, DeviceName, AccountName, InitiatingProcessCommandLine, FileName, ProcessCommandLine
A Sigma-style idea: a postgres process spawning a shell or a network download tool is rare on most servers and worth an alert. Expect noise from legitimate COPY ... PROGRAM use, archive_command and backup scripts, so baseline them first.
Investigation
If you suspect abuse before patching, preserve evidence first and patch second where you can.
- Collect PostgreSQL logs, including the log from the days before the crash or restart, and the systemd journal for the postgres unit.
- Record the DDL history: pg_stat_activity snapshot, pg_stat_statements if enabled, and the application's own query logs.
- Capture the process tree and open network connections of the postgres user, and list files recently changed under the data directory and the postgres home.
- Check the postgres account's crontab, authorized_keys and shell history, and any new files in /tmp or the data directory.
- Review pg_authid and pg_roles for new or altered roles, and pg_extension and the library directory for unexpected shared objects.
- Take a memory image and a disk snapshot of the host before restarting, if the system is high value.
- Rotate credentials stored on the server, including replication, backup and application passwords.
Our incident response and digital forensics teams follow this order of volatility on database hosts.
Mitigation
- Update the server to 18.7, 17.12, 16.16, 15.20 or 14.25, matching your major version, and restart.
- Rebuild or update every C-language extension at the same time as the server.
- Update client tools on every machine that runs them.
- Plan upgrades off any end-of-life major version.
- Remove CREATE and ALTER rights from application roles that do not need them, and restrict access to port 5432 to known application hosts.
- Run the PostgreSQL service as an unprivileged account with no unnecessary sudo, network egress or access to other secrets.
- Do not disable the composite_type_mismatch checks as a workaround.
Managed services apply fixes on the provider's own schedule, so check your provider's notices to confirm the fix is in place.
Source: PostgreSQL security advisory for CVE-2026-6460 and the 18.7 release notes.