---
id: "CVE-2026-116313"
page: "https://infrastack.ai/live/CVE-2026-116313"
kind: "vulnerability"
aliases: ["CVE-2026-116313"]
title: "PostgreSQL: vacuumdb search path lets a database owner run SQL"
severity: "high"
cvss: 7.2
epss: null
exploited: false
status: "open"
category: "runtime"
products: []
ecosystems: []
tags: ["database-admins", "postgresql", "postgresql-18", "runtime", "self-hosted"]
not_affected_if: ["patched-18.7-or-later", "postgresql-17-or-older"]
published_at: "2026-11-12T15:17:39+00:00"
first_seen_at: "2026-11-12T15:41:54+00:00"
updated_at: "2026-11-12T15:43:52+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-116313", "first_seen_at": "2026-11-12T15:41:54+00:00"}]
exploit_sources: []
---

# PostgreSQL: vacuumdb search path lets a database owner run SQL

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

PostgreSQL's vacuumdb tool trusts an unsafe search path, so a database owner can shadow operators used in its --missing-stats-only catalog query. The shadowed code runs as the database user who runs vacuumdb, which can be a superuser or an admin account.

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

## How to check

- Run `psql -c "SHOW server_version;"` or `vacuumdb --version` and compare against the fixed release.
- Check whether vacuumdb is run with `--missing-stats-only`, including from pg_upgrade guidance or scheduled jobs.

## Fix

- PostgreSQL 18: upgrade to `18.7` or later.

## Timeline

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

## From the sources

Untrusted search path in PostgreSQL vacuumdb allows a database owner to execute arbitrary SQL as the database user running vacuumdb, via shadowing operators used in the --missing-stats-only catalog query.  The pg_upgrade documentation recommends an affected vacuumdb invocation.  Within major version 18, minor versions before PostgreSQL 18.7 are affected.  Versions before PostgreSQL 18 are unaffected.

---

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