---
id: "CVE-2026-6467"
page: "https://infrastack.ai/live/CVE-2026-6467"
kind: "vulnerability"
aliases: ["CVE-2026-6467"]
title: "PostgreSQL: CREATE EXTENSION search path lets a database 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: ["managed-hosting", "only-superuser-creates-objects"]
published_at: "2026-11-12T15:17:51+00:00"
first_seen_at: "2026-11-12T15:41:57+00:00"
updated_at: "2026-11-12T15:43:49+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-6467", "first_seen_at": "2026-11-12T15:41:57+00:00"}]
exploit_sources: []
---

# PostgreSQL: CREATE EXTENSION search path lets a database user run code as superuser

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

PostgreSQL's CREATE EXTENSION and ALTER EXTENSION commands can be tricked into running an attacker's SQL, because a trusted extension script resolves the wrong object through the search path. An attacker with database-level CREATE privilege can execute arbitrary code as the bootstrap superuser.

_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 any user besides the superuser holds CREATE privilege on a database: `\l` and `\dn+` in psql.

## Fix

- PostgreSQL 18: upgrade to `18.7`
- PostgreSQL 17: upgrade to `17.12`
- PostgreSQL 16: upgrade to `16.16`
- PostgreSQL 15: upgrade to `15.20`
- PostgreSQL 14: upgrade to `14.25`

## Timeline

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

## From the sources

Uncontrolled search path element in PostgreSQL CREATE EXTENSION allows an attacker with database-level CREATE privilege to execute arbitrary code as the bootstrap superuser, via ALTER SCHEMA ... RENAME or CREATE EXTENSION ... SCHEMA "$user".  ALTER EXTENSION was also affected.  A trusted-extension script located the wrong object and executed arbitrary SQL of the attacker's choice.  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_
