Craft CMS Freeform Plugin, Stored Cross-Site Scripting, CVE-2024-xxxx (Critical)

Listen to this Post

How the CVE Works

The vulnerability exists in the Craft CMS Freeform plugin’s Control Panel (CP) React.js components. An attacker with low-privilege access to edit forms or integrations can inject malicious HTML or JavaScript into user-controlled fields, such as form labels and integration icon SVG metadata. The plugin’s frontend code then directly injects this unsanitized user input into the DOM using React’s `dangerouslySetInnerHTML` property. This occurs in key CP views like the form builder and integrations manager. Consequently, when an administrator later views a compromised form or the integrations list, the injected payload is rendered and executed in the admin’s browser context, leading to stored Cross-Site Scripting.

DailyCVE Form

Platform: Craft CMS Plugin
Version: <= 5.14.6
Vulnerability: Stored XSS
Severity: Critical
date: 2024-10-10

Prediction: Patch within 7 days.

What Undercode Say

Analytics

grep -r "dangerouslySetInnerHTML" packages/plugin/src/Resources/js/
find . -name ".js" -type f -exec grep -l "user-controlled" {} \;
// Example of vulnerable code pattern

<div dangerouslySetInnerHTML={{ __html: userProvidedLabel }} />

How Exploit

1. Attacker logs in with form-editor permissions.

2. Creates a new form field.

3. Sets field label to ``.

4. Saves the form.

5. Admin views form builder.

6. Payload executes in admin session.

Protection from this CVE

1. Sanitize all user inputs.

2. Avoid `dangerouslySetInnerHTML` for dynamic content.

3. Implement strict Content Security Policy.

4. Apply HTML encoding before rendering.

Impact

Admin session hijacking.

CSRF token theft.

Full administrative takeover.

🎯Let’s Practice Exploiting & Learn Patching For Free:

Sources:

Reported By: github.com
Extra Source Hub:
Undercode

🔐JOIN OUR CYBER WORLD [ CVE News • HackMonitor • UndercodeNews ]

💬 Whatsapp | 💬 Telegram

📢 Follow DailyCVE & Stay Tuned:

𝕏 formerly Twitter 🐦 | @ Threads | 🔗 Linkedin Featured Image

Scroll to Top