Restore restriction bypass via key disclosure vulnerability (pgAdmin 4)
Description
pgAdmin versions 9.11 are affected by a Restore restriction bypass via key disclosure vulnerability that occurs when running in server mode and performing restores from PLAIN-format dump files. An attacker with access to the pgAdmin web interface can observe an active restore operation, extract the \restrict key in real time, and race the restore process by overwriting the restore script with a payload that re-enables meta-commands using \unrestrict <key>. This results in reliable command execution on the pgAdmin host during the restore operation.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
pgadmin4PyPI | < 9.12 | 9.12 |
Affected products
1- Range: 9.11
Patches
162e2d18b0261Mask the secret key for restrict option in the process watcher when restoring plain SQL file. #9518
2 files changed · +9 −3
web/pgadmin/tools/restore/__init__.py+8 −3 modified@@ -10,7 +10,6 @@ """Implements Restore Utility""" import json -import re import secrets from flask import render_template, request, current_app, Response @@ -26,7 +25,7 @@ internal_server_error from config import PG_DEFAULT_DRIVER -from pgadmin.utils.constants import MIMETYPE_APP_JS, SERVER_NOT_FOUND +from pgadmin.utils.constants import SERVER_NOT_FOUND, RESTRICT_COMMAND from pgadmin.tools.user_management.PgAdminPermissions import AllPermissionTypes # set template path for sql scripts @@ -75,7 +74,13 @@ def cmd_arg(x): return '' for arg in _args: - if arg and len(arg) >= 2 and arg.startswith('--'): + if arg and RESTRICT_COMMAND in arg: + # Find the index where \restrict ends + idx = arg.find(RESTRICT_COMMAND) + len(RESTRICT_COMMAND) + # Keep the prefix and mask everything after it + masked_arg = arg[:idx + 1] + "x" * (len(arg) - idx - 1) + self.cmd += cmd_arg(masked_arg) + elif arg and len(arg) >= 2 and arg.startswith('--'): self.cmd += ' ' + arg else: self.cmd += cmd_arg(arg)
web/pgadmin/utils/constants.py+1 −0 modified@@ -177,3 +177,4 @@ class MessageType: RESTRICTION_TYPE_DATABASES = 'databases' RESTRICTION_TYPE_SQL = 'sql' +RESTRICT_COMMAND = '\\restrict'
Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
4- github.com/advisories/GHSA-3p7x-94q9-jq9xghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2026-1707ghsaADVISORY
- github.com/pgadmin-org/pgadmin4/commit/62e2d18b0261f88086db65059a6078db07169f18ghsaWEB
- github.com/pgadmin-org/pgadmin4/issues/9518ghsaissue-trackingWEB
News mentions
0No linked articles in our index yet.