---
id: "CVE-2026-116316"
page: "https://infrastack.ai/live/CVE-2026-116316"
kind: "vulnerability"
aliases: ["CVE-2026-116316"]
title: "PostgreSQL: temporary-schema type trick lets an object creator run SQL as caller"
severity: "high"
cvss: 8.8
epss: null
exploited: false
status: "open"
category: "runtime"
products: []
ecosystems: []
tags: ["database", "postgresql", "runtime", "self-hosted"]
not_affected_if: ["managed-hosting", "patched-version", "trusted-users-only"]
published_at: "2026-11-12T15:17:39+00:00"
first_seen_at: "2026-11-12T15:41:54+00:00"
updated_at: "2026-11-12T15:43:35+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-116316", "first_seen_at": "2026-11-12T15:41:54+00:00"}]
exploit_sources: []
---

# PostgreSQL: temporary-schema type trick lets an object creator run SQL as caller

Link for people: https://infrastack.ai/live/CVE-2026-116316 (this .md is for agents)

PostgreSQL does not fully protect an alternate code path in security-restricted operations, so a user who creates a domain, enum, or range type in a pg_temp schema can run arbitrary SQL as whoever triggers that operation. The victim session must later run a query with an unqualified type name, such as SELECT '1'::bigint, and autovacuum and other common background users are not affected.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Run `SELECT version();` in psql and compare against the fixed versions below.
- Check whether untrusted users can create objects in their own temporary schemas on the server.

## Fix

- PostgreSQL `18.7`
- PostgreSQL `17.12`
- PostgreSQL `16.16`
- PostgreSQL `15.20`
- PostgreSQL `14.25`

## Timeline

- 2026-11-12T15:41:54+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-116316

## From the sources

Improper protection of alternate path in PostgreSQL security-restricted operations allows an object creator to execute arbitrary SQL as the operation's caller, via a domain, enum, or range type created in pg_temp.  The victim session must later run a query containing an unqualified type name, e.g. "SELECT '1'::bigint"; autovacuum and other common security-restricted operation users do not do so, so they are unaffected.  Versions before PostgreSQL 18.7, 17.12, 16.16, 15.20, and 14.25 are affected.

---

_Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai_
