CVE-2025-4168
Executive Summary
CVE-2025-4168 is a Stored Cross-Site Scripting (XSS) vulnerability in the Subpage List plugin for WordPress, affecting all versions up to and including 1.3.3. The flaw resides in the subpages shortcode, where user-supplied attributes are not properly sanitized or escaped. An authenticated attacker with contributor-level access or higher can inject arbitrary web scripts into pages. When a victim (including administrators) visits the compromised page, the injected script executes in their browser, potentially leading to session hijacking, defacement, or further privilege escalation.
This vulnerability is part of the WordPress ecosystem and does not involve Apache or Nginx directly. The plugin is used to display lists of subpages, making it a common target for content injection attacks.
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 is a WordPress plugin vulnerability. The plugin is distributed via the official WordPress plugin repository. Users should verify the integrity of their plugin files and ensure they are not using modified versions from untrusted sources. No known supply chain compromise has been reported for this specific CVE.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N
- Base Score: 6.4 (Medium)
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: Low (Contributor-level access)
- User Interaction: None
- Scope: Changed (vulnerability impacts resources beyond the vulnerable component)
- Confidentiality Impact: Low
- Integrity Impact: Low
- Availability Impact: None
Threat Level: Medium. The requirement for authenticated access reduces the attack surface, but the potential for stored XSS in a WordPress context can lead to significant impact, including admin account takeover if combined with other techniques.
Deep Dive & Mechanics
The vulnerability exists in the subpages shortcode handler. The plugin fails to properly sanitize user-supplied attributes (e.g., title, class, id) before outputting them in the generated HTML. An attacker with contributor-level access can create or edit a post/page and insert the [subpages] shortcode with malicious attributes.
For example, an attacker could use:
[subpages title="<script>alert('XSS')</script>"]
When the shortcode is rendered, the title attribute is echoed directly into the HTML without escaping, causing the script to execute.
The lack of output escaping on dynamic attributes is the root cause. WordPress provides functions like esc_attr() and esc_html() that should be used to sanitize output, but the plugin developers omitted these.
Vulnerable vs. Patched Code
Vulnerable Code (version 1.3.3):
// In subpage-list.php
function subpages_shortcode($atts) {
extract(shortcode_atts(array(
'title' => '',
'class' => '',
'id' => '',
), $atts));
$output = '<div class="subpage-list"';
if (!empty($id)) {
$output .= ' id="' . $id . '"';
}
if (!empty($class)) {
$output .= ' class="' . $class . '"';
}
$output .= '>';
if (!empty($title)) {
$output .= '<h2>' . $title . '</h2>';
}
// ... rest of the code
return $output;
}
Patched Code (hypothetical fix):
function subpages_shortcode($atts) {
$atts = shortcode_atts(array(
'title' => '',
'class' => '',
'id' => '',
), $atts);
$output = '<div class="subpage-list"';
if (!empty($atts['id'])) {
$output .= ' id="' . esc_attr($atts['id']) . '"';
}
if (!empty($atts['class'])) {
$output .= ' class="' . esc_attr($atts['class']) . '"';
}
$output .= '>';
if (!empty($atts['title'])) {
$output .= '<h2>' . esc_html($atts['title']) . '</h2>';
}
// ... rest of the code
return $output;
}
The fix uses esc_attr() for HTML attributes and esc_html() for text content, preventing XSS.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- WordPress instance with Subpage List plugin <= 1.3.3
- Authenticated user with Contributor role or higher
Exploitation Steps:
- Log in as a contributor.
- Create a new post or page.
- Insert the shortcode with a malicious attribute:
[subpages title="<img src=x onerror=alert('XSS')>"] - Publish or save the post.
- When any user (including admin) views the post, the XSS payload executes.
Advanced Payload:
[subpages title="<script>fetch('/wp-admin/admin-ajax.php?action=add_admin&user=attacker&pass=evil').then(r=>r.text()).then(console.log)</script>"]
Note: This is a conceptual payload; actual admin creation requires additional steps.
Blue Team (Detection & Hardening)
Detection:
- Monitor for shortcode usage with suspicious attributes in post content.
- Look for
[subpagesfollowed byonerror,onload,<script>, or other event handlers. - Check WordPress logs for unusual post revisions containing script tags.
Hardening:
- Disable the plugin until a patch is available.
- Use a Web Application Firewall (WAF) to block XSS payloads in shortcode attributes.
- Restrict contributor-level access to trusted users only.
- Implement Content Security Policy (CSP) headers to mitigate XSS impact.
Indicators of Compromise (IOCs)
- File:
/wp-content/plugins/subpage-list/subpage-list.php(version <= 1.3.3) - Post Content Pattern:
[subpages title="<script>...</script>"]or similar XSS vectors - HTTP Request: POST to
/wp-admin/post.phpwithpost_contentcontaining malicious shortcode - Log Entry: WordPress audit logs showing shortcode usage with unusual attributes
Detection Engineering
YARA Rule
rule wordpress_subpage_list_xss {
meta:
description = "Detects malicious shortcode attributes in Subpage List plugin"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-4168"
strings:
$shortcode = /\[subpages\s+[^\]]*?(?:on\w+\s*=|src\s*=|href\s*=)/ nocase
$script_tag = /<script[^>]*>/
$event_handler = /on\w+\s*=\s*['"]?[^'"]*['"]?/
condition:
$shortcode and ($script_tag or $event_handler)
}
Sigma Rule
title: WordPress Subpage List Plugin Stored XSS
id: 8f7a3b2c-1d4e-5f6a-7b8c-9d0e1f2a3b4c
status: experimental
description: Detects stored XSS attempts via Subpage List shortcode
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
cs-uri-stem: '/wp-admin/post.php'
cs-uri-query:
- '*action=edit*'
- '*action=post*'
keywords:
- '[subpages'
- 'onerror='
- 'onload='
- '<script'
condition: selection and keywords
falsepositives:
- Legitimate use of shortcode with safe attributes
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (
msg:"CVE-2025-4168 WordPress Subpage List Stored XSS Attempt";
flow:to_server,established;
content:"POST"; http_method;
content:"/wp-admin/post.php"; http_uri;
content:"[subpages";
pcre:"/\[subpages\s+[^\]]*?(?:on\w+\s*=|src\s*=|href\s*=)/i";
classtype:web-application-attack;
sid:1000001;
rev:1;
)
Remediation & Mitigation
Immediate Actions:
- Disable the plugin until an official patch is released.
- Review all posts/pages for malicious shortcode usage and remove them.
- Change all user passwords if compromise is suspected.
Long-term Fix:
- Apply the patched code (see Vulnerable vs. Patched Code section) or wait for the vendor to release an update.
- Implement a WordPress security plugin that monitors for XSS attempts.
- Regularly audit user roles and permissions.
Workaround:
- Use a WAF rule to block shortcode attributes containing
<script>or event handlers. - Add the following to
.htaccess(if using Apache) to block malicious shortcode in POST data:<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_METHOD} POST RewriteCond %{REQUEST_URI} /wp-admin/post.php RewriteCond %{THE_REQUEST} .*\[subpages.*(onerror|onload|<script).* [NC] RewriteRule .* - [F,L] </IfModule>
Valters IT
Securing Digital Frontiers
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.