Postgres Shipped 52 Security Fixes on 12 November. Revoking the TEMPORARY Privilege Covers Only Some.
44 of them need nothing more than an ordinary login. Least privilege narrows the path to a few; the patch is what closes the rest.
On 12 November the PostgreSQL project released 18.7, 17.12, 16.16, 15.20 and 14.25 with fixes for 52 CVEs. Six days later a researcher at Depthfirst published a proof of concept showing that one of them, CVE-2026-116331, turns a freshly created login role with no grants into command execution on the database server. The recommended hardening step, revoking the TEMPORARY privilege that every Postgres database hands to PUBLIC, is now doing the rounds as the mitigation. It is a good change. It covers a minority of the release.
This piece is for the engineer who owns a Postgres cluster, has a maintenance window to book, and is deciding whether a grants change buys enough time to wait for it.
What the release contains
The release announcement lists each CVE with its CVSS 3.1 vector. Reading the Privileges Required field across all 52 gives a blunt picture.
| Privileges required | CVEs | What it means |
|---|---|---|
| Low (PR:L), no user interaction | 43 | Any role that can log in and run SQL. 29 of these are rated 8.8. |
| Low, with user interaction | 1 | reindexdb quoting; needs an admin to run the tool. |
| None, with user interaction | 3 | pg_restore, pg_dump tar archives, logical replication from a hostile publisher. |
| None | 2 | A pre-auth cancel-request spinlock leak and a pg_basebackup format string. |
| High (PR:H) | 3 | Extension script handling and vacuumdb; needs owner-level rights. |
Most of the 8.8 entries share a phrase in their title: "executes arbitrary code". Type confusion, use-after-free and integer wraparound in the planner, the executor, text search and the procedural languages. The attacker in each case is an account you created on purpose.
Why the default TEMPORARY privilege matters
When you create a database, PUBLIC receives CONNECT and TEMPORARY. Postgres 15 removed the old default that let everyone CREATE in the public schema, but it left TEMPORARY alone. With it, any login role gets a private schema, pg_temp, where it can create tables, indexes, functions, types and aggregates without touching a single application object.
That is the building material the CVE-2026-116331 advisory describes: a user-defined aggregate whose SORTOP option makes the planner treat its input and result as the same type when they are not. The Depthfirst write-up chains that into a heap pointer leak, a bounded read and finally a call to system(). No table was read. No grant was abused. The role did only what the defaults allowed it to do.
“SQL grants decide which objects a role can touch. They do not decide which engine code its queries run through.”
What revoking TEMPORARY closes, and what it leaves
Taking the release titles at face value, the low-privilege bugs fall into three rough groups. This is our reading of short advisory titles, not a substitute for each CVE page, but it is enough to show where the grants change helps.
| Group | Examples | Revoking TEMPORARY + schema CREATE |
|---|---|---|
| Needs new objects | 116331 user-defined aggregate; 116335 commutator/negator operators; 116316 types in pg_temp; 6460 ALTER ... SET DATA TYPE | Blocks the route for roles with no other CREATE rights or owned tables |
| Needs an installed language or extension | 116307, 116309, 116319, 116320, 116326 plperl; 116323 pltcl; 14661, 120147 dblink; 120149 FDW batch insert | Helps where functions would go in pg_temp; removing unused extensions helps more |
| Reachable through ordinary queries | 116315 tsvector_delete overflow; 116317 ts_rank_cd overflow; 120139 tuple-size wraparound; 116328 memory context wraparound | No effect. Built-in functions are executable by PUBLIC. |
The third group is the one that matters for planning. A heap overflow in a text-search function needs a role that can run SELECT, and every role you have can run SELECT. The grants change shrinks the set of published routes. The minor upgrade removes the bugs.
Who actually holds a login
The useful audit is not "which roles are privileged". It is "which credentials can open a session at all", because that list is now the attack surface until the upgrade lands. On a typical SaaS cluster it is longer than the team remembers:
- The application role, plus one per service in a microservice setup.
- The migration role in CI, whose password lives in a secrets store that more people can read than the database.
- Read-only roles for BI tools and dashboards, often shared across a team.
- Support or operations accounts used for one-off queries.
- Third-party integrations: data sync, reverse ETL, observability agents that run queries.
- Former employees' personal roles that were never dropped.
Each of these used to be judged by what it could read. A leaked dashboard password was a data-exposure incident. Against an unpatched server it is also a shell. That changes which credentials deserve rotation and which roles should simply be dropped this week.
The audit, in five queries
Run these as a superuser, or as the master user on a managed service. The last block is the change itself; apply it after you know which roles need temporary objects.
-- 1. Which databases still carry the default ACL?
-- A NULL datacl means PUBLIC has CONNECT and TEMPORARY.
SELECT datname, datacl
FROM pg_database
WHERE datallowconn;
-- 2. Which login roles can create temporary objects here?
SELECT rolname
FROM pg_roles
WHERE rolcanlogin
AND has_database_privilege(oid, current_database(), 'TEMPORARY');
-- 3. Which login roles can create objects in a real schema?
-- Clusters upgraded from 14 or earlier may still allow
-- CREATE on public for everyone.
SELECT n.nspname, r.rolname
FROM pg_namespace n
CROSS JOIN pg_roles r
WHERE r.rolcanlogin
AND n.nspname NOT LIKE 'pg\_%'
AND n.nspname <> 'information_schema'
AND has_schema_privilege(r.oid, n.oid, 'CREATE');
-- 4. What extra engine code is installed?
SELECT lanname, lanpltrusted FROM pg_language;
SELECT extname, extversion FROM pg_extension;
-- 5. Narrow it. Grant TEMPORARY back only to roles that use it.
REVOKE TEMPORARY ON DATABASE appdb FROM PUBLIC;
GRANT TEMPORARY ON DATABASE appdb TO app_writer;
REVOKE CREATE ON SCHEMA public FROM PUBLIC;Two things to expect. First, the role list in query 2 will include every login role on an unmodified database, which is the point. Second, revoking TEMPORARY breaks anything that creates temp tables: bulk loaders that COPY into a staging temp table before an upsert are the usual casualty, followed by some ETL connectors and analysts' ad hoc scripts. The error is explicit, "permission denied to create temporary tables", so it surfaces fast in staging. Grant the privilege back to named roles, never to PUBLIC.
Query 3 catches a quieter leftover. Clusters upgraded with pg_upgrade from 14 or earlier keep the old public-schema ACL, so CREATE on public may still be open to everyone even on 18. That gives a role a permanent place to build objects, and revoking TEMPORARY alone would not touch it.
MySQL and ClickHouse have the same shape
The research was not Postgres-specific, and The Hacker News summary collects the vendor status. On MySQL, CVE-2026-101786 sits in the query optimiser and affects 26.7.0 to 26.7.1. Oracle rates it as needing high privileges; the researcher reached code execution with an account that could only CREATE TEMPORARY TABLES ON *.* and could not read any existing table. That grant shows up in a lot of reporting roles because BI tools ask for it. It was fixed in the October update.
On ClickHouse the trigger was a session setting: format_binary_max_string_size=0 passed in the HTTP query string, which disables a length check in the RowBinary reader. ClickHouse says it fixed the issue in early September, in 26.9 and backports to 26.8.3.41, 26.7.7.30, 26.6.5.55 and 26.3.32.8. The hardening lesson outlives the fix: users who do not need to change settings should run with readonly=1, and settings that guard memory safety can be pinned with constraints in the user's settings profile so a query cannot override them.
Oracle is the outlier. Its chain, through the Oracle REST Data Services GraphQL interface and Oracle Text, runs before any login, so no role design helps. The November patch update and keeping ORDS off the public internet are the only controls there.
Sequencing the work this week
- Book the minor upgrade. It is a binary swap and a restart, no dump or pg_upgrade. Read the post-update notes for GIN, pg_trgm GiST and bpchar reindexing before you schedule it.
- On a managed service, check whether your provider offers the fixed minor version yet and whether automatic minor upgrades are switched on. If not, the window is yours to request.
- Until then, drop dead login roles, rotate shared BI and support passwords, and revoke TEMPORARY and public-schema CREATE where staging shows nothing breaks.
- Remove procedural languages and extensions nobody uses. Every installed one is engine code a low-privilege role can reach.
- Keep the new grants after the upgrade. The next release will have its own list.
One branch has no next release. The announcement states that 14.25 is the final PostgreSQL 14 release, which we covered in our note on the Postgres 14 end-of-life dates. A cluster that stays on 14 keeps every low-privilege bug found from here on, and the only mitigations left are the grants on this page.
Least privilege was designed to keep a role away from data it should not see. Against a memory-safety bug in the engine, the number that matters is how many credentials can open a session, and that number is something most teams have never had to count.
Frequently asked questions
Related reading
Workday's DR Test Wrote to Production. A Standby That Can Reach the Primary Needs a Fence.
On 13 November, services in Workday's disaster recovery site connected to production databases during a test. Replication means your DR site can probably reach your primary too. Here is how to fence it.
Optimizely Served Malware to 178 Organisations. A Content Security Policy Blocked It for Only 24.
On 16 November, Optimizely snippets delivered a card skimmer and crypto clipper to 178 organisations. Report URI checked their CSPs: 68 had none, 50 had one that allowed everything, and 24 blocked the payload.
Postgres 14 Reaches End of Life on 12 November. On RDS, the Date That Bills You Is 1 March 2027.
The Postgres community stops patching version 14 on 12 November 2026. Amazon RDS keeps it in standard support until 28 February 2027, then charges. Here is how to read the gap.