---
id: "CVE-2026-120153"
page: "https://infrastack.ai/live/CVE-2026-120153"
kind: "vulnerability"
aliases: ["CVE-2026-120153"]
title: "PostgreSQL: SQL injection in extension scripts lets a CREATE-privilege user run code as superuser"
severity: "high"
cvss: 7.2
epss: null
exploited: false
status: "open"
category: "runtime"
products: []
ecosystems: []
tags: ["database", "postgresql", "runtime", "self-hosted"]
not_affected_if: ["bundled-extensions-only", "no-create-privilege-users", "patched-version"]
published_at: "2026-11-12T15:17:44+00:00"
first_seen_at: "2026-11-12T15:41:56+00:00"
updated_at: "2026-11-12T15:43:50+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-120153", "first_seen_at": "2026-11-12T15:41:56+00:00"}]
exploit_sources: []
---

# PostgreSQL: SQL injection in extension scripts lets a CREATE-privilege user run code as superuser

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

PostgreSQL extension-script substitutions do not escape schema or owner names, so a crafted name containing newlines or special substrings injects SQL. An attacker with database-level CREATE privilege can run arbitrary code as the bootstrap superuser.

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

## How to check

- Check the server version with `SELECT version();` and compare it to the fixed versions below.
- Look for non-bundled extensions installed on the server that use script substitutions of schema or owner names.

## 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-120153

## From the sources

SQL injection in PostgreSQL extension-script substitutions allows an attacker with database-level CREATE privilege to execute arbitrary code as the bootstrap superuser, via a schema or owner name containing newlines or other special substrings.  This is similar to CVE-2023-39417, but it requires a non-bundled extension with a vulnerable script pattern.  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_
