
A comprehensive vulnerability scanner for CVE-2025-13780, a Remote Code Execution (RCE) vulnerability in pgAdmin 4 versions ≤ 8.14.
A comprehensive vulnerability scanner for CVE-2025-13780, a Remote Code Execution (RCE) vulnerability in pgAdmin 4 versions ≤ 8.14.
The vulnerability exists in the Restore feature of pgAdmin 4. The application attempts to block dangerous shell commands (starting with \) using a regular expression. However, this check can be bypassed.
(^|\n)[ \t]*\\\xef\xbb\xbf makes the regex fail to match\n\r instead of \n before the backslash# Clone the repository
git clone https://github.com/ThemeHackers/CVE-2025-13780.git
cd CVE-2025-13780
# Install dependencies
pip install -r requirements.txt
requests - HTTP library for API requestsrich (optional) - Enhanced terminal output with colors and progress barspython-socketio & websocket-client (optional) - WebSocket support for exploit mode# Basic scan
python3 scanner.py http://localhost:5050
# With authentication
python3 scanner.py http://localhost:5050 --email [email protected] --password admin
# Verbose mode
python3 scanner.py http://localhost:5050 -v
# Scan from file
python3 scanner.py -f targets.txt
# With multi-threading (default: 5 threads)
python3 scanner.py -f targets.txt --threads 10
# Export results to JSON
python3 scanner.py -f targets.txt -o results.json --json
The scanner calculates a confidence score (0-100) based on multiple factors:
For versions ≤ 8.14:
For versions > 8.14:
For unknown versions:
Use Docker Compose to set up a vulnerable pgAdmin 4 instance:
docker-compose up -d
[email protected]admin| Code | Meaning |
|---|---|
| 0 | No vulnerabilities found |
| 1 | One or more vulnerable targets found |
| 2 | Scan errors occurred |
╔═══════════════════════════════════════════════════════════════╗
║ CVE-2025-13780 pgAdmin 4 Scanner ║
║ Regex Bypass Remote Code Execution ║
║ ║
║ Affected: pgAdmin 4 <= 8.14 ║
╚═══════════════════════════════════════════════════════════════╝
[*] Checking connectivity to http://localhost:5050
[+] Target appears to be pgAdmin
[+] Detected version: 8.14
[+] CSRF token obtained
[!] Version 8.14 is in vulnerable range (<= 8.14)
[*] Testing regex bypass patterns
[+] BOM bypass: BYPASSED
[+] CRLF bypass: BYPASSED
⚠️ VULNERABILITY DETECTED ⚠️
This tool is provided for educational and authorized security testing purposes only.
This project is licensed under the MIT License - see the LICENSE file for details.
| Option | Description |
|---|
target | Target URL (e.g., http://localhost:5050) |
-f, --file | File containing list of targets (one per line) |
-e, --email | pgAdmin email for authentication |
-p, --password | pgAdmin password for authentication |
-o, --output | Output file for results |
--json | Output results in JSON format |
-q, --quiet | Suppress banner and info messages |
-v, --verbose | Enable verbose/debug output |
-t, --timeout | Request timeout in seconds (default: 10) |
--threads | Number of threads for multi-target scanning (default: 5) |
--exploit-demo | Run exploit demonstration mode |
--exploit | Execute real exploit (requires --lhost) |
--lhost | Attacker IP for reverse shell callback |
--lport | Attacker port for reverse shell (default: 4444) |
--cmd | Custom command to execute (optional) |
| Factor | Max Points | Details |
|---|
| Version in vulnerable range (≤ 8.14) | 40 | Version detected as ≤ 8.14 |
| Version unknown | 15 | When version cannot be determined |
| Restore endpoint accessible | 25 | Restore API accessible without auth |
| Restore endpoint (requires auth) | 15 | Restore API exists but requires authentication |
| Both BOM and CRLF bypasses work | 25 | Both regex bypass methods succeed |
| One bypass method works | 20 | Either BOM or CRLF bypass succeeds |
| Browser endpoint accessible | 10 | Main pgAdmin interface accessible |