---
id: "CVE-2026-116328"
page: "https://infrastack.ai/live/CVE-2026-116328"
kind: "vulnerability"
aliases: ["CVE-2026-116328"]
title: "PostgreSQL: integer wraparound lets a database user run OS code"
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", "postgresql-15-or-older"]
published_at: "2026-11-12T15:17:41+00:00"
first_seen_at: "2026-11-12T15:41:55+00:00"
updated_at: "2026-11-12T15:43:25+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-116328", "first_seen_at": "2026-11-12T15:41:55+00:00"}]
exploit_sources: []
---

# PostgreSQL: integer wraparound lets a database user run OS code

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

PostgreSQL's generation memory contexts have an integer wraparound bug triggered by freeing an allocation over 1 GB. A database user can use it to 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 the version against the affected ranges
- Check the installed server version with `postgres --version`
- Affected: major versions 16 to 18 before `18.7`, `17.12`, and `16.16`

## Fix

- Upgrade PostgreSQL 18 to `18.7` or later
- Upgrade PostgreSQL 17 to `17.12` or later
- Upgrade PostgreSQL 16 to `16.16` or later
- Versions before PostgreSQL 16 are unaffected

## Timeline

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

## From the sources

Integer wraparound in PostgreSQL generation memory contexts allows a database user to execute arbitrary code as the operating system user running the database, via freeing an allocation larger than 1 GB and causing its block to be reused for smaller chunks whose back-pointer offset cannot represent that position.  Within major versions 16-18, minor versions before PostgreSQL 18.7, 17.12, and 16.16 are affected.  Versions before PostgreSQL 16 are unaffected.

---

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