CVE-2025-31864
Executive Summary
CVE-2025-31864 is a Stored Cross-Site Scripting (XSS) vulnerability in the WordPress plugin Beam me up Scotty (slug: beam-me-up-scotty), developed by Out the Box. The vulnerability affects all versions up to and including 1.0.23. It allows an authenticated attacker with contributor-level privileges or higher to inject arbitrary web scripts into pages, which are then executed whenever a user accesses the compromised page. The vulnerability stems from improper neutralization of user-supplied input during web page generation. As of this report, no official patch has been released, and the vendor has not responded to disclosure attempts. The EPSS score is 0.0%, indicating low exploitation likelihood in the wild, but the risk remains significant for sites with untrusted contributors.
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 resides in a WordPress plugin distributed via the official WordPress plugin repository. The plugin is not available on NPM, PyPI, Go, or Ruby ecosystems. However, as a WordPress plugin, it is part of the broader PHP/WordPress supply chain. Users should verify the integrity of the plugin files and consider removing the plugin if no patch is forthcoming. The lack of a patch and vendor responsiveness increases supply chain risk for all sites using this plugin.
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: 5.9 (Medium)
- Attack Vector (AV): Network (N) – The vulnerability is exploitable remotely.
- Attack Complexity (AC): Low (L) – No special conditions required.
- Privileges Required (PR): Low (L) – Attacker needs contributor-level access.
- User Interaction (UI): Required (R) – Victim must visit the compromised page.
- Scope (S): Changed (C) – The injected script can affect 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 moderate, the stored nature of the XSS means that a single injection can affect all subsequent visitors, making it a persistent threat for high-traffic sites.
Deep Dive & Mechanics
The vulnerability exists in the beam-me-up-scotty plugin, which provides a "beam me up" button or similar functionality. The plugin fails to sanitize user input before storing it in the WordPress database and later rendering it on the frontend. Specifically, the plugin likely uses echo or the_content filter without proper escaping functions like esc_html() or wp_kses_post().
Root Cause: The plugin does not apply output escaping when displaying user-submitted content (e.g., button text, URLs, or custom CSS classes). An attacker with contributor-level access can inject JavaScript payloads into these fields. When an administrator or visitor views the page, the payload executes in their browser context.
Attack Flow:
- Attacker logs in as a contributor.
- Attacker creates or edits a post/page and inserts the
beam-me-up-scottyshortcode or block. - Attacker injects a malicious payload into a plugin-specific field (e.g.,
[beam_me_up_scotty button_text="<script>alert('XSS')</script>"]). - The payload is stored in the database without sanitization.
- When any user (including admins) views the page, the script executes.
WordPress Ecosystem Note: This is a WordPress plugin vulnerability. The issue is not with the Apache or Nginx web server, but with the plugin's failure to follow WordPress coding standards for output escaping.
Vulnerable vs. Patched Code
Since no patch is available, the following shows the vulnerable code pattern and the recommended fix.
Vulnerable Code (hypothetical example from plugin):
// In beam-me-up-scotty.php or similar
function beam_me_up_scotty_shortcode($atts) {
$atts = shortcode_atts(array(
'button_text' => 'Beam Me Up',
), $atts);
// VULNERABLE: Direct output without escaping
return '<button class="beam-me-up">' . $atts['button_text'] . '</button>';
}
add_shortcode('beam_me_up_scotty', 'beam_me_up_scotty_shortcode');
Patched Code (recommended fix):
function beam_me_up_scotty_shortcode($atts) {
$atts = shortcode_atts(array(
'button_text' => 'Beam Me Up',
), $atts);
// FIX: Escape output using esc_html()
return '<button class="beam-me-up">' . esc_html($atts['button_text']) . '</button>';
}
add_shortcode('beam_me_up_scotty', 'beam_me_up_scotty_shortcode');
Key Difference: The patched version uses esc_html() to neutralize any HTML/JavaScript before output. Additionally, the plugin should use wp_kses_post() for rich text fields if HTML is allowed.
Exploitation & Lab Setup
Red Team
Prerequisites:
- WordPress site with
beam-me-up-scottyplugin version <= 1.0.23. - Attacker account with Contributor role or higher.
Exploitation Steps:
- Log in to WordPress as a contributor.
- Create a new post or page.
- Insert the shortcode
[beam_me_up_scotty button_text="<script>alert(document.cookie)</script>"]. - Publish the post.
- Send the link to an administrator or wait for a visitor.
- When the victim views the page, the JavaScript executes.
Advanced Payload (session hijacking):
<script>
fetch('/wp-admin/admin-ajax.php?action=your_custom_action', {
method: 'POST',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: 'cookie=' + document.cookie
});
</script>
Note: No public exploit code exists in Exploit-DB at this time.
Blue Team
Detection & Response:
- Monitor for shortcode injection: Look for posts/pages containing
<script>tags within shortcode attributes. - Audit user roles: Restrict contributor-level access to trusted users only.
- Web Application Firewall (WAF): Deploy rules to block XSS payloads in POST data.
- Content Security Policy (CSP): Implement a strict CSP to mitigate XSS impact (e.g.,
script-src 'self').
Lab Setup for Testing:
- Use a local WordPress instance (e.g., via Docker or Local by Flywheel).
- Install the vulnerable plugin version 1.0.23.
- Create a test contributor account.
- Follow the Red Team steps to verify the vulnerability.
Indicators of Compromise (IOCs)
- File Hashes (SHA256) of vulnerable plugin:
beam-me-up-scotty.1.0.23.zip:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855(placeholder – replace with actual hash)
- Database entries: Posts/pages containing shortcode with
<script>tags. - HTTP requests: POST requests to
/wp-admin/post.phpwithcontentparameter containing XSS payloads. - Log entries: PHP error logs showing
unexpectedoutput or JavaScript execution attempts.
Detection Engineering
YARA Rule
rule CVE_2025_31864_Beam_Me_Up_Scotty_XSS {
meta:
description = "Detects stored XSS payloads in Beam me up Scotty plugin shortcodes"
author = "Valters IT"
date = "2025-04-10"
cve = "CVE-2025-31864"
strings:
$shortcode = /\[beam_me_up_scotty[^\]]*\]/ nocase
$xss_payload = /<script[^>]*>.*<\/script>/i
condition:
$shortcode and $xss_payload
}
Sigma Rule
title: Stored XSS via Beam me up Scotty Plugin
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects stored XSS attempts in WordPress posts using the Beam me up Scotty plugin
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: wordpress
detection:
selection:
http.method: 'POST'
http.url: '/wp-admin/post.php'
http.body|contains: 'beam_me_up_scotty'
http.body|contains: '<script'
condition: selection
falsepositives:
- Legitimate use of JavaScript in posts (rare)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (
msg:"CVE-2025-31864 - Stored XSS in Beam me up Scotty Plugin";
flow:to_server,established;
content:"POST";
http_method;
content:"/wp-admin/post.php";
http_uri;
content:"beam_me_up_scotty";
http_client_body;
content:"<script";
http_client_body;
classtype:web-application-attack;
sid:10000001;
rev:1;
)
Remediation & Mitigation
Immediate Actions:
- Disable the plugin until a patch is available.
- Remove or sanitize any existing posts/pages containing the vulnerable shortcode.
- Restrict contributor roles to only trusted users.
Long-term Fix:
- The vendor must release a patched version that properly escapes output using
esc_html()orwp_kses_post(). - If no patch is forthcoming, consider replacing the plugin with an alternative.
Workaround:
- Use a WordPress security plugin (e.g., Wordfence) to block XSS payloads.
- Implement a Web Application Firewall (WAF) with custom rules to filter
<script>tags in shortcode attributes.
Valters IT – Securing digital ecosystems through proactive threat intelligence.
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.