Skip to main content
Vulnerability Database/CVE-2025-22558

CVE-2025-22558: mcjh button shortcode Stored XSS Flaw

CVE-2025-22558 is a stored cross-site scripting vulnerability in the mcjh button shortcode WordPress plugin that enables attackers to inject malicious scripts. This article covers technical details, affected versions, and mitigation.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2025-22558 Overview

CVE-2025-22558 is a stored Cross-Site Scripting (XSS) vulnerability in the Marcus C. J. Hartmann mcjh-button-shortcode WordPress plugin. The flaw affects all versions up to and including 1.6.4. Authenticated contributors can inject malicious JavaScript through improperly sanitized shortcode parameters. The payload persists in the database and executes in the browser of any visitor rendering the affected page. The vulnerability is classified under CWE-79 (Improper Neutralization of Input During Web Page Generation).

Critical Impact

Stored XSS enables session hijacking, administrative account takeover, and malicious redirects affecting all users who view the compromised content.

Affected Products

  • Marcus C. J. Hartmann mcjh-button-shortcode plugin for WordPress
  • All plugin versions from n/a through 1.6.4
  • WordPress sites with contributor-level or higher authenticated users

Discovery Timeline

  • 2025-01-07 - CVE-2025-22558 published to NVD
  • 2026-06-17 - Last updated in NVD database

Technical Details for CVE-2025-22558

Vulnerability Analysis

The mcjh-button-shortcode plugin provides a WordPress shortcode that renders styled buttons from user-supplied attributes. The plugin fails to neutralize input before echoing attribute values into the generated HTML output. An attacker with contributor privileges can embed JavaScript payloads in shortcode attributes. When an editor, administrator, or visitor loads the resulting page, the payload executes in their browser context.

Stored XSS of this type is persistent. The payload remains active until the malicious post is edited or deleted. Common exploitation outcomes include theft of authenticated session cookies, forced actions on behalf of the victim, injection of cryptocurrency miners, and redirect chains to phishing infrastructure.

Root Cause

The root cause is missing output encoding and input sanitization inside the shortcode handler. WordPress exposes helpers such as esc_attr(), esc_html(), and wp_kses() for safe output, but the vulnerable handler emits attribute values directly into the DOM. Because shortcodes execute with the privileges of the post author, any contributor-level account becomes a stepping stone to higher-privileged accounts that view the content.

Attack Vector

The attack is network-based and requires low privileges plus user interaction, as reflected in the CVSS vector. A typical sequence involves an attacker registering or compromising a contributor account, submitting a post that uses the vulnerable shortcode with a crafted attribute containing a JavaScript event handler or <script> tag, and waiting for a privileged user to preview or publish the post. The scope-changed designation reflects that the injected script runs in the browser trust boundary of other users. See the Patchstack XSS Vulnerability Advisory for the vendor-coordinated technical write-up.

Detection Methods for CVE-2025-22558

Indicators of Compromise

  • Post content or postmeta entries containing shortcode attributes with <script>, onerror=, onload=, or javascript: strings tied to the mcjh-button shortcode
  • Outbound browser requests from WordPress admin sessions to unexpected external domains
  • New or modified administrator accounts created shortly after contributor account activity
  • Browser console errors referencing unknown external JavaScript loaded by button shortcode markup

Detection Strategies

  • Query the WordPress wp_posts table for the string [mcjh-button combined with HTML event handlers or script tags
  • Enable Content Security Policy (CSP) reporting to surface inline script execution attempts on pages rendering the shortcode
  • Review contributor-authored posts awaiting review for suspicious shortcode attribute values
  • Monitor web server logs for anomalous POST requests to /wp-admin/post.php from newly registered accounts

Monitoring Recommendations

  • Alert on creation of new WordPress accounts followed by rapid post submissions containing shortcodes
  • Track plugin inventory to flag sites still running mcjh-button-shortcode versions 1.6.4 or earlier
  • Correlate admin session cookie use from unexpected geolocations with recent contributor content submissions

How to Mitigate CVE-2025-22558

Immediate Actions Required

  • Deactivate the mcjh-button-shortcode plugin until a patched release is confirmed via the WordPress plugin repository
  • Audit all existing posts and drafts for shortcode usage and remove entries with suspicious attribute values
  • Rotate credentials and session tokens for administrator and editor accounts that may have viewed malicious posts
  • Restrict contributor registration and require manual approval for new author-level accounts

Patch Information

At the time of this analysis, the Patchstack advisory lists versions through 1.6.4 as vulnerable with no fixed release identified. Monitor the Patchstack advisory and the plugin's WordPress.org page for a security update. Apply the fixed version across all WordPress environments once available.

Workarounds

  • Remove the plugin entirely and replace button styling with native theme components or a maintained alternative
  • Deploy a web application firewall rule that blocks shortcode submissions containing HTML event handler attributes or <script> payloads
  • Enforce a strict Content Security Policy that disallows inline script execution on the public site
  • Limit shortcode usage to administrator and editor roles via a role-management plugin until the vendor patches the issue
bash
# Disable the vulnerable plugin via WP-CLI until a patched version ships
wp plugin deactivate mcjh-button-shortcode
wp plugin delete mcjh-button-shortcode

# Audit stored content for likely XSS payloads in the shortcode
wp db query "SELECT ID, post_title FROM wp_posts \
  WHERE post_content LIKE '%[mcjh-button%' \
  AND (post_content LIKE '%<script%' \
       OR post_content LIKE '%onerror=%' \
       OR post_content LIKE '%javascript:%');"

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.