---
id: "CVE-2026-120142"
page: "https://infrastack.ai/live/CVE-2026-120142"
kind: "vulnerability"
aliases: ["CVE-2026-120142"]
title: "PostgreSQL: type confusion in anonymous record types allows code execution"
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", "postgresql-below-17"]
published_at: "2026-11-12T15:17:42+00:00"
first_seen_at: "2026-11-12T15:41:56+00:00"
updated_at: "2026-11-12T15:43:15+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-120142", "first_seen_at": "2026-11-12T15:41:56+00:00"}]
exploit_sources: []
---

# PostgreSQL: type confusion in anonymous record types allows code execution

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

PostgreSQL mishandles anonymous RECORD types whose dropped columns differ in width or alignment, causing type confusion. An attacker 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

- Check the running server version with `SELECT version();` or `postgres --version`
- Confirm the major version is 17 or 18 and the minor version is below `18.7` or `17.12`

## Fix

- Upgrade PostgreSQL 18 to `18.7`
- Upgrade PostgreSQL 17 to `17.12`

## Timeline

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

## From the sources

Type confusion in PostgreSQL anonymous RECORD types allows an object creator to execute arbitrary code as the operating system user running the database, via row types having dropped attributes in the same positions but with different widths or alignments.  Within major versions 17-18, minor versions before PostgreSQL 18.7 and 17.12 are affected.  Versions before PostgreSQL 17 are unaffected.

---

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