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

CVE-2025-11241: Yoast SEO Premium XSS Vulnerability

CVE-2025-11241 is a stored XSS vulnerability in Yoast SEO Premium plugin for WordPress that enables attackers with Contributor access to inject malicious scripts. This article covers technical details, affected versions, and mitigation.

Published:

CVE-2025-11241 Overview

CVE-2025-11241 is a Stored Cross-Site Scripting (XSS) vulnerability in the Yoast SEO Premium plugin for WordPress, affecting versions 25.7 through 25.9. The flaw originates in a regular expression intended to strip an attribute from post content. Attackers can abuse the regex to inject arbitrary HTML attributes, including JavaScript event handlers. Exploitation requires Contributor-level access or higher, and the injected payload executes in the context of any user who views the affected post. The issue is tracked under CWE-80 (Improper Neutralization of Script-Related HTML Tags).

Critical Impact

Authenticated low-privilege users can persist JavaScript payloads in post content, enabling session hijacking, privilege escalation through administrator interaction, and site defacement.

Affected Products

  • Yoast SEO Premium for WordPress version 25.7
  • Yoast SEO Premium for WordPress version 25.8
  • Yoast SEO Premium for WordPress version 25.9

Discovery Timeline

  • 2025-10-03 - CVE-2025-11241 published to NVD
  • 2026-04-15 - Last updated in NVD database

Technical Details for CVE-2025-11241

Vulnerability Analysis

The vulnerability resides in a sanitization routine that uses a regular expression to remove a specific HTML attribute from post content before rendering. The regex pattern is not anchored or escaped correctly, which allows crafted input to evade attribute stripping. An authenticated user with Contributor permissions can submit a post containing a payload that survives the filter and is later reflected into the rendered DOM with attacker-controlled attributes such as onmouseover, onerror, or onclick.

When an administrator, editor, or site visitor loads the affected post, the browser parses the unsanitized HTML and executes the attached JavaScript. The attack scope is changed because the script runs in the context of the WordPress site, granting access to the victim's session cookies, nonces, and the WordPress REST API. Refer to the Wordfence Vulnerability Analysis for additional context.

Root Cause

The root cause is a flawed regex pattern used for HTML attribute removal. Regex-based HTML parsing is brittle because HTML permits unquoted attributes, mixed quoting, whitespace variations, and nested tags. The pattern matches only well-formed input, so adversaries craft malformed yet browser-tolerant markup that bypasses the filter. Tools such as the Stealthcopter RegexSS Tool illustrate how regex sanitizers fail against valid HTML edge cases.

Attack Vector

A Contributor-level account creates or edits a post, embedding HTML that includes attacker-controlled attributes. The flawed regex fails to strip the malicious attributes during save or render. When the post is viewed, the embedded event handler fires and executes JavaScript in the viewer's browser session.

No public proof-of-concept code or exploit module is referenced in the advisory. The vulnerability is described in prose by the vendor changelog at the Yoast SEO Premium Changelog.

Detection Methods for CVE-2025-11241

Indicators of Compromise

  • Post content in wp_posts containing inline event handler attributes such as onmouseover=, onerror=, onclick=, or onload= injected by Contributor-role accounts.
  • Unexpected <script> tags or javascript: URI schemes inside posts authored by low-privilege users.
  • New or modified WordPress administrator accounts created shortly after a Contributor submitted or edited content.
  • Outbound requests from administrator browser sessions to attacker-controlled domains following post previews.

Detection Strategies

  • Query the WordPress database for posts authored by Contributor-role users containing HTML event-handler attributes or javascript: strings.
  • Inspect Yoast SEO Premium plugin versions across managed WordPress installations and flag any instance running 25.7, 25.8, or 25.9.
  • Review web server access logs for POST requests to /wp-admin/post.php and /wp-json/wp/v2/posts originating from Contributor accounts followed by privileged-user GET requests to the same post IDs.

Monitoring Recommendations

  • Enable WordPress audit logging to track post creation, edits, and role changes initiated by non-administrator accounts.
  • Forward web application firewall logs to a centralized analytics platform and alert on requests containing inline event handlers in post body parameters.
  • Monitor for anomalous outbound DNS or HTTP traffic from administrator workstations after visits to author-submitted draft posts.

How to Mitigate CVE-2025-11241

Immediate Actions Required

  • Upgrade Yoast SEO Premium to version 26.0 or later on every WordPress installation where the plugin is active.
  • Audit Contributor, Author, and Editor accounts and remove or downgrade any account that is not strictly required.
  • Review all posts created or modified by Contributor-level users since the deployment of Yoast SEO Premium 25.7 for embedded event handlers or scripts.

Patch Information

Yoast addressed the vulnerability in Yoast SEO Premium 26.0. Release notes are published in the Yoast SEO Premium Changelog. Apply the update through the WordPress plugin manager or by deploying the updated plugin package via configuration management.

Workarounds

  • Temporarily revoke post creation and edit permissions from Contributor-role accounts until the patch is applied.
  • Deploy a web application firewall rule that blocks HTTP request bodies containing inline JavaScript event handlers submitted to WordPress post endpoints.
  • Enforce content review workflows so that administrator preview of Contributor-submitted posts occurs only in isolated browser sessions.
bash
# Update Yoast SEO Premium using WP-CLI
wp plugin update wordpress-seo-premium --version=26.0

# Verify installed version
wp plugin get wordpress-seo-premium --field=version

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

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

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.