CVE-2026-6828

Fluent Forms <= 6.2.1 - Authenticated (Contributor+) Stored Cross-Site Scripting via 'permission_message' Shortcode Attribute

mediumImproper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
6.4
CVSS Score
6.4
CVSS Score
medium
Severity
6.2.2
Patched in
1d
Time to patch

Description

The Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder plugin for WordPress is vulnerable to Stored Cross-Site Scripting via the 'permission_message' parameter in all versions up to, and including, 6.2.1 due to insufficient input sanitization and output escaping. This makes it possible for authenticated attackers, with contributor-level access and above, to inject arbitrary web scripts in pages that will execute whenever a user accesses an injected page.

CVSS Vector Breakdown

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N
Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Changed
Low
Confidentiality
Low
Integrity
None
Availability

Technical Details

Affected versions<=6.2.1
PublishedMay 12, 2026
Last updatedMay 13, 2026
Affected pluginfluentform

What Changed in the Fix

Changes introduced in v6.2.2

Loading patch diff...

Source Code

WordPress.org SVN
Research Plan
Unverified

# Vulnerability Research Plan: CVE-2026-6828 - Fluent Forms Stored XSS ## 1. Vulnerability Summary The **Fluent Forms** plugin (up to version 6.2.1) is vulnerable to **Stored Cross-Site Scripting (XSS)** via the `permission_message` attribute in its primary shortcode. This occurs because the plugin…

Show full research plan

Vulnerability Research Plan: CVE-2026-6828 - Fluent Forms Stored XSS

1. Vulnerability Summary

The Fluent Forms plugin (up to version 6.2.1) is vulnerable to Stored Cross-Site Scripting (XSS) via the permission_message attribute in its primary shortcode. This occurs because the plugin fails to sanitize or escape the attribute value when rendering the "access denied" message for a form. An authenticated attacker with Contributor privileges can use the shortcode in a post or page to inject malicious JavaScript that executes when a user (including administrators) views that page and fails a form restriction check.

2. Attack Vector Analysis

  • Shortcode: [fluentform]
  • Vulnerable Attribute: permission_message
  • Authentication Level: Contributor or higher (any role capable of using shortcodes in posts/pages).
  • Precondition: The form referenced in the shortcode must have a restriction enabled (e.g., "Require Login") that is triggered by the victim viewing the page.
  • Payload Location: Embedded within the post_content of a WordPress Post or Page.

3. Code Flow

  1. Shortcode Registration: The plugin registers the [fluentform] shortcode (typically in a class like ShortCodeParser or Component).
  2. Parsing: When a page containing the shortcode is rendered, the ShortCodeParser parses attributes, including id and permission_message.
  3. Permission Check: The code identifies the form by id and evaluates its settings (e.g., requireLogin found in fluentform_form_meta).
  4. Sink: If the current viewer does not meet the requirements (e.g., is a guest or lacks a specific role), the parser renders a message. If the permission_message attribute is present in the shortcode, the code returns/echoes it directly without calling esc_html() or wp_kses().

4. Nonce Acquisition Strategy

This vulnerability is exploited by creating or editing a WordPress post. While a Contributor can do this via the UI, an automated agent should use the WordPress REST API or the standard post.php endpoint.

  1. Create Page for Nonce: No specific Fluent Forms nonce is required for the shortcode itself. However, to create a form or change settings as an Admin during setup, the fluent_form_entries_vars or similar JS objects might contain nonces for the Fluent Forms API.
  2. Accessing Fluent Forms Nonce (for Setup):
    • Navigate to the Fluent Forms dashboard: wp-admin/admin.php?page=fluent_forms.
    • Use browser_eval to extract the nonce:
      window.fluent_forms_global_var?.nonce
      
    • (Note: Based on app/Modules/Entries/EntryViewRenderer.php, the plugin localizes fluent_form_entries_vars on entry pages, but for general form management, look for fluent_forms_global_var).

5. Exploitation Strategy

Step 1: Target Identification

Find a valid Form ID. If none exist, create one.

# Get the ID of the first available form
wp db query "SELECT id FROM wp_fluentform_forms LIMIT 1"

Step 2: Test Data Setup (Admin)

Configure a form to be restricted so the permission_message is triggered.

  1. Enable "Require Login" for Form ID 1.
  2. This is done by updating the formSettings meta key in the fluentform_form_meta table.

Step 3: Payload Injection (Contributor)

As a Contributor, create a post containing the malicious shortcode.

wp post create --post_type=post --post_status=publish --post_author=[CONTRIB_ID] \
--post_title="Contact Us" \
--post_content='[fluentform id="1" permission_message="<script>alert(document.domain)</script>"]'

Step 4: Triggering the XSS (Guest/Victim)

Access the post as a guest or any user that triggers the "Require Login" restriction.

  • Endpoint: GET /?p=[POST_ID]
  • Payload: The shortcode attribute permission_message will be rendered in the HTML body.

6. Test Data Setup

  1. Existing Form: Ensure at least one form exists. Use wp eval to insert a blank form if necessary.
  2. Restriction Setting:
    // Example SQL/PHP to force a restriction
    $settings = json_decode(get_db_val_for_form_1_settings);
    $settings['restrictions']['requireLogin']['enabled'] = true;
    // Update DB
    
  3. Contributor User: wp user create attacker attacker@example.com --role=contributor --user_pass=password123.

7. Expected Results

When visiting the post URL as an unauthenticated user (Guest):

  1. The form container will appear.
  2. Instead of the form fields, the message <script>alert(document.domain)</script> will be rendered in the DOM.
  3. The browser will execute the script, showing an alert box.

8. Verification Steps

  1. HTTP Verification:
    • Use http_request to fetch the post content.
    • Check if the response body contains the raw payload:
      grep "<script>alert(document.domain)</script>"
  2. Database Verification:
    • Verify the post content is stored exactly as injected:
      wp db query "SELECT post_content FROM wp_posts WHERE ID = [POST_ID]"

9. Alternative Approaches

If the id attribute is checked for existence before the message is displayed:

  • Ensure the id in the shortcode matches a real ID in wp_fluentform_forms.

If the script is blocked by a Content Security Policy (CSP):

  • Use an <img> tag with onerror:
    [fluentform id="1" permission_message="<img src=x onerror=alert(1)>"]

If the message is rendered inside a <div> but sanitization occurs:

  • Try breaking out of the context if the message is used inside a JS variable:
    [fluentform id="1" permission_message="';alert(1)//"] (though this is less likely given the description).
Research Findings
Static analysis — not yet PoC-verified

Summary

The Fluent Forms plugin is vulnerable to Stored Cross-Site Scripting via the 'permission_message' shortcode attribute because it fails to sanitize or escape this input before rendering it in an error message. Authenticated attackers with Contributor-level access or higher can inject malicious JavaScript into a post, which then executes when a user viewing the page fails a form access restriction check.

Vulnerable Code

// app/Modules/Component/Component.php line 511 (v6.2.1)
if (!empty($atts['permission'])) {
    if (!current_user_can($atts['permission'])) {
        return "<div id='ff_form_{$form->id}' class='ff_form_not_render'>{$atts['permission_message']}</div>";
    }
}

---

// app/Modules/Component/Component.php line 567 (v6.2.1)
if (is_array($isRenderable) && !$isRenderable['status']) {
    return "<div id='ff_form_{$form->id}' class='ff_form_not_render'>{$isRenderable['message']}</div>";
}

Security Fix

--- /home/deploy/wp-safety.org/data/plugin-versions/fluentform/6.2.1/app/Modules/Component/Component.php	2026-04-16 11:38:36.000000000 +0000
+++ /home/deploy/wp-safety.org/data/plugin-versions/fluentform/6.2.2/app/Modules/Component/Component.php	2026-04-23 12:58:12.000000000 +0000
@@ -510,7 +510,7 @@
 
         if (!empty($atts['permission'])) {
             if (!current_user_can($atts['permission'])) {
-                return "<div id='ff_form_{$form->id}' class='ff_form_not_render'>{$atts['permission_message']}</div>";
+                return $this->getNotRenderableHtml($form->id, $atts['permission_message']);
             }
         }
 
@@ -565,7 +565,7 @@
         $isRenderable = $this->app->applyFilters('fluentform/is_form_renderable', $isRenderable, $form);
 
         if (is_array($isRenderable) && !$isRenderable['status']) {
-            return "<div id='ff_form_{$form->id}' class='ff_form_not_render'>{$isRenderable['message']}</div>";
+            return $this->getNotRenderableHtml($form->id, $isRenderable['message']);
         }
 
         $instanceCssClass = Helper::getFormInstaceClass($form->id);
@@ -805,6 +805,13 @@
         return $output . $otherScripts;
     }
 
+    protected function getNotRenderableHtml($formId, $message)
+    {
+        return "<div id='ff_form_" . esc_attr($formId) . "' class='ff_form_not_render'>"
+            . wp_kses_post($message)
+            . "</div>";
+    }
+
     /**
      * Process the output HTML to generate the default values.
      *

Exploit Outline

1. Identify a target Fluent Form ID (e.g., id="1") that has a restriction enabled, such as 'Require Login'. 2. Log in to the WordPress site with Contributor privileges or higher. 3. Create a new post or page and embed the malicious shortcode: [fluentform id="1" permission_message="<script>alert(document.domain)</script>"]. 4. Publish or save the post. 5. As a victim user (e.g., an administrator or an unauthenticated guest), navigate to the URL of the newly created post. 6. Because the victim triggers the form's restriction (e.g., if they are not logged in or lack a required capability), the plugin renders the value of the 'permission_message' attribute directly into the HTML, causing the injected script to execute.

Check if your site is affected.

Run a free security audit to detect vulnerable plugins, outdated versions, and misconfigurations.