CVE-2026-86864 is a pgAdmin vulnerability where argument-vector injection via getopt_long's argument permutation allows database name or connection string injection into pg_dump invocations. The technical root cause is straightforward: the Backup tool constructs pg_dump arguments by appending user-supplied database names to the command line, and getopt_long permutes argument order in ways that can reinterpret a malicious database name as a flag or connection string. The fix — passing PGDATABASE as an environment variable instead — mirrors the pattern already used by pgAdmin's Import/Export tool, confirming the safe approach existed in the same codebase but wasn't applied consistently.
Two exploitation paths exist from the same entry point. First, a database name containing a file path overwrites pgAdmin's SQLite configuration database, achieving denial of service. Second, a crafted connection string redirects pg_dump's connection to an attacker-controlled PostgreSQL instance, exfiltrating the PGPASSWORD credential. The second vector's severity depends on whether the compromised credential holds superuser privileges — if pgAdmin manages production databases with elevated access, this becomes a pivot point into downstream systems.
The permission model amplifies the impact significantly. The tools_backup permission is assigned to the default User role by default, meaning any authenticated pgAdmin user can trigger the vulnerable code path. This isn't an admin-only operation; it's accessible to developers, analysts, and automated pipelines with baseline access. The horizontal blast radius across all users makes this a organizational-wide exposure rather than a narrow insider threat.
The underlying failure is a knowledge-transfer breakdown: one team implemented the safe pattern in Import/Export, another team used the unsafe pattern in Backup, and no shared abstraction or invariant enforcement caught the divergence. The getopt_long permutation behavior is documented but obscure — most application developers building a web-based database UI aren't modeling POSIX option-parsing edge cases.
Audit your pgAdmin deployment for other pg_dump or psql invocations that pass database names through argument vectors rather than environment variables. Check whether any user with the default User role has tools_backup assigned, and whether pgAdmin connects to high-privilege PostgreSQL accounts that would make credential exfiltration a critical risk. The fix is simple — enforce PGDATABASE and PGPASSWORD through environment isolation — but the real question is whether other forgotten code paths in pgAdmin's CLI invocations carry similar assumptions that haven't been audited against this class of flaw.