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.
The product searches for critical resources using an externally-supplied search path that can point to resources that are not under the product’s direct control.
| Name | Vendor | Start Version | End Version |
|---|---|---|---|
| Red Hat Hardened Images | RedHat | postgresql18-main-18.7-0.1.hum1 | * |
| Red Hat Hardened Images | RedHat | postgresql17-main-17.11-1.2.hum1 | * |
| Red Hat Hardened Images | RedHat | libpq-main-18.7-0.1.hum1 | * |
| Postgresql-10 | Ubuntu | upstream | * |
| Postgresql-12 | Ubuntu | upstream | * |
| Postgresql-9.3 | Ubuntu | upstream | * |
| Postgresql-9.5 | Ubuntu | upstream | * |
This might allow attackers to execute their own programs, access unauthorized data files, or modify configuration in unexpected ways. If the product uses a search path to locate critical resources such as programs, then an attacker could modify that search path to point to a malicious program, which the targeted product would then execute. The problem extends to any type of critical resource that the product trusts. Some of the most common variants of untrusted search path are: