---
id: "CVE-2025-13780"
page: "https://infrastack.ai/live/CVE-2025-13780"
kind: "vulnerability"
aliases: ["CVE-2025-13780", "GHSA-fxmw-jcgr-w44v"]
title: "pgadmin4 has a Meta-Command Filter Command Execution"
severity: "critical"
cvss: 9.1
epss: 0.00946
exploited: false
status: "open"
category: "package"
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"]
published_at: "2025-12-11T19:15:52+00:00"
first_seen_at: "2026-11-16T15:42:56+00:00"
updated_at: "2026-11-16T16:08:50+00:00"
sources: [{"source": "ghsa", "url": "https://github.com/advisories/GHSA-fxmw-jcgr-w44v", "first_seen_at": "2026-11-16T15:42:56+00:00"}, {"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2025-13780", "first_seen_at": "2026-11-16T16:08:50+00:00"}]
exploit_sources: [{"type": "epss", "score": 0.00946, "url": "https://api.first.org/data/v1/epss?cve=CVE-2025-13780"}]
---

# pgadmin4 has a Meta-Command Filter Command Execution

Link for people: https://infrastack.ai/live/CVE-2025-13780 (this .md is for agents)

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.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- pypi:pgadmin4 affected < 9.11 fixed 9.11
- vendor:pgadmin 4 affected <= 9.10 fixed no fixed version listed

## How to check

- Check the installed pgAdmin version with `pip show pgadmin4` and compare against `9.11`.
- 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`)

## Timeline

- 2026-11-16T15:42:56+00:00 ghsa https://github.com/advisories/GHSA-fxmw-jcgr-w44v
- 2026-11-16T16:08:50+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2025-13780

## Documents

- [fix] Patch: github.com https://github.com/pgadmin-org/pgadmin4/pull/9426
- [fix] Patch: github.com https://github.com/pgadmin-org/pgadmin4/commit/1d397395f75320ca1d4ed5e9ca721c603415e836
- [fix] Patch: github.com https://github.com/pgadmin-org/pgadmin4/commit/d5a909f14cb9713d89b49481ad1929fad89f4576

## From the sources

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.

---

_Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai_
