← News
/DISPATCH · 2026-08-04

CVE-2026-17566: pgAdmin 4 RCE disclosed (CVSS 9.4), same root as incompletely patched CVE-2025-13780

pgAdmin 4 disclosed critical RCE CVE-2026-17566 (CVSS 9.4) in the Import/Export Data Jinja template that converts SQL to psql copy commands. Backslash-escape mismatch lets an authenticated attacker break out of the query wrap and run arbitrary system commands via psql. Same class as the incomplete 2025 CVE-2025-13780 fix.

Overview

pgAdmin 4 is the PostgreSQL community's most widely used open-source web admin console. More than 15 million developers and DBAs use it daily. Researchers disclosed a critical RCE in the Import/Export Data tool. Assigned CVE-2026-17566. CVSS 9.4 (Critical).

The bug sits in the Jinja template that converts SQL into psql copy commands. Backslash escaping does not match between incoming SQL and psql. An authenticated user can break out of the query wrap and make psql run arbitrary system commands. This is not unauthenticated internet RCE. It needs an enterprise pgAdmin account. Because the console is the DBA daily admin surface, post-auth code execution still makes it a useful pivot.

Technical details

pgAdmin 4 Import/Export Data lets users import and export SQL query results from the client. To turn an SQL string into a backend `psql ... \copy ... FROM` statement, the backend concatenates via a Jinja template. The design was supposed to keep user SQL inside `\copy ... FROM STDIN`. The code only handled some escape characters. Backslash escaping on user input is inconsistent:

An authenticated user can submit SQL that looks like a query but breaks out of `\copy`. Injecting `\;`, special escape characters, or multi-line query structure can make psql treat a later token as a new command. That command can call psql helpers such as `\!` (shell) or `\copy ... PROGRAM` to run arbitrary system code. The code runs as the pgAdmin service process.

Triggering it requires injecting commands into this path. Given routine debug, repro, and data-import use, plus common enterprise "submit a query for the project owner" workflows, exploit likelihood is not low. Advisory notes this is the same class as CVE-2025-13780 from 2025. The earlier fix did not fully cover the same escape model. Patching only the reported sink is not enough. All escape paths need a systematic rewrite.

Impact

Mitigation

References