BIT-postgresql-2026-116318: PostgreSQL pg_dump not-null constraint name allows SQL injection
SQL injection in PostgreSQL pgdump allows an object creator to execute arbitrary SQL as the user restoring the dump, via an inherited column having a child-local not-null constraint whose name requires quoting. Within major version 18, minor versions before PostgreSQL 18.7 are affected. Versions before PostgreSQL 18 are unaffected.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
bitnami/postgresqlto a version that resolves this vulnerability.Fixed in 18.7.0 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 18.7
Event History
Frequently Asked Questions
Who is exposed to this issue?
Deployments running PostgreSQL 18 before 18.7 are affected. Versions before PostgreSQL 18 are unaffected.
What does an attacker need to exploit it?
An attacker must be able to create a database object involving an inherited column with a child-local not-null constraint whose name requires quoting. Exploitation occurs when a dump containing that object is restored by another user.
What is the impact of restoring a malicious dump?
Arbitrary SQL can execute with the privileges of the user performing the restore. This can affect confidentiality, integrity, and availability at the privilege level of that restore user.
What should be done if an affected version is in use?
Update PostgreSQL 18 to version 18.7 or later. Until then, treat dumps that may contain objects created by untrusted users as unsafe to restore, particularly when restoring with privileged accounts.