{"id":"CVE-2025-13780","kind":"vulnerability","aliases":["CVE-2025-13780","GHSA-fxmw-jcgr-w44v"],"related":[],"title":"pgadmin4 has a Meta-Command Filter Command Execution","description":"The PLAIN restore meta-command filter introduced in pgAdmin as part of the fix for CVE-2025-12762 does not detect meta-commands when a SQL file begins with a UTF-8 Byte Order Mark (EF BB BF) or other special byte sequences. The implemented filter uses the function `has_meta_commands()`, which scans raw bytes using a regular expression. The regex does not treat the bytes as ignorable, so meta-commands such as `\\\\!` remain undetected. When pgAdmin invokes psql with --file, psql strips the bytes and executes the command. This can result in remote command execution during a restore operation.","summary":"pgAdmin's filter for dangerous psql meta-commands during restore misses SQL files that start with a UTF-8 byte order mark. An attacker who supplies such a file can get psql to run a shell command through a meta-command such as \\! during a restore.","severity":"critical","cvss":9.1,"epss":0.00946,"exploited":false,"exploited_at":null,"products":[{"name":"pgadmin4","fixed":["9.11"],"affected":"< 9.11","ecosystem":"pypi"},{"name":"pgadmin 4","fixed":[],"affected":"<= 9.10","ecosystem":"vendor"}],"ecosystems":["pypi","vendor"],"tags":["cwe-77","cwe-94","package","pgadmin4","postgresql","python","self-hosted"],"not_affected_if":["no-sql-restore","pgadmin-9.11-or-later"],"how_to_check":"- Check the installed pgAdmin version with `pip show pgadmin4` and compare against `9.11`.\n- Look for pgAdmin 4 servers that let users upload or restore SQL files.","fix":"- `pgadmin4` `9.11` (fixed version per the product range; affected below `9.11`)","status":"open","published_at":"2025-12-11T19:15:52+00:00","first_seen_at":"2026-11-16T15:42:56+00:00","triaged_at":"2026-11-16T15:44:09+00:00","updated_at":"2026-11-16T16:08:50+00:00","category":"package","confidence":0.8,"triage":{"at":"2026-11-16T15:44:09Z","model":"claude-haiku-5-5","output":{"fix":"- `pgadmin4` `9.11` (fixed version per the product range; affected below `9.11`)","reach":"network","title":"pgAdmin: crafted restore file runs shell commands on the server","impact":"high","summary":"pgAdmin's filter for dangerous psql meta-commands during restore misses SQL files that start with a UTF-8 byte order mark. An attacker who supplies such a file can get psql to run a shell command through a meta-command such as \\! during a restore.","audience":"businesses","category":"package","nicknames":[],"who_cares":["pgadmin4","python","postgresql","self-hosted"],"confidence":0.8,"fix_status":"available","needs_auth":"yes","worst_case":"Code runs on the server hosting pgAdmin","analyst_note":"","how_to_check":"- Check the installed pgAdmin version with `pip show pgadmin4` and compare against `9.11`.\n- Look for pgAdmin 4 servers that let users upload or restore SQL files.","plain_action":"","product_name":"","needs_analyst":false,"not_affected_if":["no-sql-restore","pgadmin-9.11-or-later"],"who_is_affected":"Teams running pgAdmin 4 in a server or desktop-hosted setup where users can restore SQL files through the PLAIN restore feature. Installations that never restore user-supplied SQL files are less exposed. The sources do not say whether managed hosting changes exposure.","user_interaction":"unknown","product_ecosystem":"","needs_special_setup":"unknown","severity_if_unknown":"critical"},"cost_usd":0.000748,"input_tokens":4747,"output_tokens":547,"severity_before":"critical"},"analyst_status":null,"analyst_note":null,"search":"'-12762':101C '-13780':12A,20A '-2025':11A,19A,100C '-77':25B '-8':54B,116C '-94':27B '4':23A 'attack':59B 'bb':121C 'begin':112C 'bf':122C 'byte':55B,117C,126C,140C,151C,171C 'command':6A,8A,43B,72B,77B,88C,107C,136C,157C,175C,181C 'cve':10A,18A,99C 'cwe':24B,26B 'danger':39B 'detect':104C 'ef':120C 'execut':9A,173C,182C 'express':144C 'file':48B,64B,111C,167C 'filter':7A,37B,89C,130C 'fix':97C 'function':133C 'fxmw':15A 'get':66B 'ghsa':14A 'ghsa-fxmw-jcgr-w44v':13A 'host':34B 'ignor':153C 'implement':129C 'introduc':90C 'invok':164C 'jcgr':16A 'mark':57B,119C 'meta':5A,42B,76B,87C,106C,135C,156C 'meta-command':4A,41B,75B,86C,105C,155C 'miss':46B 'oper':186C 'order':56B,118C 'packag':28B 'part':94C 'pgadmin':22A,35B,92C,163C 'pgadmin4':1A,21A,29B 'plain':84C 'postgresql':30B 'psql':40B,67B,165C,168C 'python':31B 'raw':139C 'regex':146C 'regular':143C 'remain':160C 'remot':180C 'restor':45B,82B,85C,185C 'result':178C 'run':69B 'scan':138C 'self':33B 'self-host':32B 'sequenc':127C 'shell':71B 'special':125C 'sql':47B,110C 'start':50B 'strip':169C 'suppli':61B 'treat':149C 'undetect':161C 'use':131C,141C 'utf':53B,115C 'w44v':17A","nicknames":[],"mitigations":[],"who_affected":"Teams running pgAdmin 4 in a server or desktop-hosted setup where users can restore SQL files through the PLAIN restore feature. Installations that never restore user-supplied SQL files are less exposed. The sources do not say whether managed hosting changes exposure.","tier":"B","verified":{},"analyst_revisit_at":null,"fix_status":"available","audience":"businesses","plain_action":null,"pkeys":["4","pgadmin4"],"ptokens":["pgadmin","pgadmin4"],"labels":["critical","cwe77","cwe94","package","pgadmin4","postgresql","pypi","python","selfhosted","vendor"],"campaign_type":null,"search_a":"'-13780':12A,20A '-2025':11A,19A '4':23A 'command':6A,8A 'cve':10A,18A 'execut':9A 'filter':7A 'fxmw':15A 'ghsa':14A 'ghsa-fxmw-jcgr-w44v':13A 'jcgr':16A 'meta':5A 'meta-command':4A 'pgadmin':22A 'pgadmin4':1A,21A 'w44v':17A","search_b":"'-77':25B '-8':54B '-94':27B 'attack':59B 'byte':55B 'command':43B,72B,77B 'cwe':24B,26B 'danger':39B 'file':48B,64B 'filter':37B 'get':66B 'host':34B 'mark':57B 'meta':42B,76B 'meta-command':41B,75B 'miss':46B 'order':56B 'packag':28B 'pgadmin':35B 'pgadmin4':29B 'postgresql':30B 'psql':40B,67B 'python':31B 'restor':45B,82B 'run':69B 'self':33B 'self-host':32B 'shell':71B 'sql':47B 'start':50B 'suppli':61B 'utf':53B","search_c":"'-12762':101C '-2025':100C '-8':116C 'bb':121C 'begin':112C 'bf':122C 'byte':117C,126C,140C,151C,171C 'command':88C,107C,136C,157C,175C,181C 'cve':99C 'detect':104C 'ef':120C 'execut':173C,182C 'express':144C 'file':111C,167C 'filter':89C,130C 'fix':97C 'function':133C 'ignor':153C 'implement':129C 'introduc':90C 'invok':164C 'mark':119C 'meta':87C,106C,135C,156C 'meta-command':86C,105C,155C 'oper':186C 'order':118C 'part':94C 'pgadmin':92C,163C 'plain':84C 'psql':165C,168C 'raw':139C 'regex':146C 'regular':143C 'remain':160C 'remot':180C 'restor':85C,185C 'result':178C 'scan':138C 'sequenc':127C 'special':125C 'sql':110C 'strip':169C 'treat':149C 'undetect':161C 'use':131C,141C 'utf':115C","cause_entry":null,"cause_path":null,"disclosures_checked_at":null,"first_public_at":"2025-12-11T19:15:52+00:00","kev":null,"cvss_vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:L/A:L","cvss_by":"GitHub","poc_count":0,"sources":[{"source":"ghsa","external_id":"GHSA-fxmw-jcgr-w44v","url":"https://github.com/advisories/GHSA-fxmw-jcgr-w44v","severity":"critical","published_at":"2025-12-11T21:31:28+00:00","modified_at":"2026-11-16T15:41:59+00:00","first_seen_at":"2026-11-16T15:42:56+00:00","fetched_at":"2026-11-16T15:46:58+00:00","note":null},{"source":"nvd","external_id":"CVE-2025-13780","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-13780","severity":null,"published_at":"2025-12-11T19:15:52+00:00","modified_at":"2026-10-07T20:10:01+00:00","first_seen_at":"2026-11-16T16:08:50+00:00","fetched_at":"2026-11-16T16:08:50+00:00","note":null}],"documents":[{"id":170707,"url":"https://github.com/pgadmin-org/pgadmin4/pull/9426","title":"Patch: github.com","kind":"other","source":"ghsa","publisher":"vendor","text":null,"published_at":null,"relation":"fix","confidence":null,"note":"Patch: github.com"},{"id":170708,"url":"https://github.com/pgadmin-org/pgadmin4/commit/1d397395f75320ca1d4ed5e9ca721c603415e836","title":"Patch: github.com","kind":"other","source":"ghsa","publisher":"vendor","text":null,"published_at":null,"relation":"fix","confidence":null,"note":"Patch: github.com"},{"id":170709,"url":"https://github.com/pgadmin-org/pgadmin4/commit/d5a909f14cb9713d89b49481ad1929fad89f4576","title":"Patch: github.com","kind":"other","source":"ghsa","publisher":"vendor","text":null,"published_at":null,"relation":"fix","confidence":null,"note":"Patch: github.com"}],"disclosures":[],"exploit_sources":[{"type":"epss","score":0.00946,"url":"https://api.first.org/data/v1/epss?cve=CVE-2025-13780"}],"notice":"Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai"}