Skip to content
Threat Feed
high advisory

PostgreSQL: Arbitrary SQL execution in vacuumdb (CVE-2026-116313)

An untrusted search path vulnerability in the PostgreSQL vacuumdb utility allows a malicious database owner to execute arbitrary SQL commands via operator shadowing during --missing-stats-only operations.

CVE search metadata

CVE search record: CVE-2026-116313. Severity: high. CVSS: 7.2. KEV: no. Product: PostgreSQL (18.0 <= version < 18.7). Brief: PostgreSQL: Arbitrary SQL execution in vacuumdb (CVE-2026-116313). Brief link: https://feed.craftedsignal.io/briefs/2026-11-postgresql-vacuumdb-rce-cve-2026-116313/

Triage facts

Revision 1
Applicability
PostgreSQL (18.0 <= version < 18.7)
Evidence
Unknown
Severity
High
Action
Elevated
Sources
1 public source
Freshness
Revision 1Nov 12, 16:52 UTC
Vulnerabilities
1 CVE
Source quality
A1Likely

PostgreSQL versions 18.0 through 18.6 contain an untrusted search path vulnerability in the vacuumdb utility (CVE-2026-116313). A malicious database owner can exploit this flaw by shadowing operators used in the --missing-stats-only catalog query. When a higher-privileged user or an automated process executes this specific vacuumdb command, the malicious operator is invoked, allowing the attacker to execute arbitrary SQL as the user running the utility. This issue arises from improper handling of the search path, which can be manipulated to redirect lookups.

Impact

Successful exploitation allows a low-privileged database owner to execute arbitrary SQL with the privileges of the user running the vacuumdb utility. This can lead to privilege escalation or unauthorized data access if the utility is executed by a superuser or a user with elevated system permissions.

Recommendation

Upgrade PostgreSQL to version 18.7 or later. Review all automated scripts or cron jobs that invoke vacuumdb, particularly those using the --missing-stats-only flag, to ensure they are not run with excessive privileges until the patch is applied.


Immediate actions

Inventory all systems running PostgreSQL version 18.0 through 18.6.

IT Operations 48h

Upgrade affected PostgreSQL instances to version 18.7 or later.

IT Operations 1w

Threat Hunt

Identify automated processes or cron jobs that execute vacuumdb with the --missing-stats-only flag.

medium medium confidence hunt now

Data: Process execution logs (command line arguments), Scheduler/Cron task configurations

Mitigations

Upgrade to PostgreSQL 18.7 or later to address CVE-2026-116313.

immediate IT Operations

CVE-2026-116313