---
id: "CVE-2026-120148"
page: "https://infrastack.ai/live/CVE-2026-120148"
kind: "vulnerability"
aliases: ["CVE-2026-120148"]
title: "PostgreSQL: extended statistics type confusion lets an object creator run OS code"
severity: "high"
cvss: 8.1
epss: null
exploited: false
status: "open"
category: "runtime"
products: []
ecosystems: []
tags: ["database", "postgresql", "runtime", "self-hosted"]
not_affected_if: ["managed-hosting", "trusted-object-creators-only"]
published_at: "2026-11-12T15:17:43+00:00"
first_seen_at: "2026-11-12T15:41:56+00:00"
updated_at: "2026-11-12T15:43:43+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-120148", "first_seen_at": "2026-11-12T15:41:56+00:00"}]
exploit_sources: []
---

# PostgreSQL: extended statistics type confusion lets an object creator run OS code

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

PostgreSQL extended statistics mishandle an anonymous RECORD type in a statistics expression, a type confusion bug. A user who can create database objects can execute arbitrary code as the operating system user running the database.

_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 listed below.
- Check whether untrusted users can create objects, including extended statistics, in your databases.

## Fix

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

## Timeline

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

## From the sources

Type confusion in PostgreSQL extended statistics allows an object creator to execute arbitrary code as the operating system user running the database, via a statistics expression of an anonymous RECORD type whose backend-local type identifier denotes a different row type in another session.  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_
