Published : November 27, 2026

CVE-2026-107769: Fluent Forms <= 6.2.15 Unauthenticated Account Pre-Hijacking via Unverified Identifier via 'payer_email' / 'user_register' Hook Reassignment PoC, Patch Analysis & Rule

Plugin fluentform
Severity Low (CVSS 3.1)
CWE 57
Vulnerable Version 6.2.15
Patched Version 6.2.16
Disclosed November 25, 2026

Free WordPress WAF

Protect your site at the edge

Atomic Edge blocks exploit traffic, bots, and bad requests before they reach WordPress. Create a free account, then point DNS when you are ready.

Get Protected Free

Analysis Overview

Atomic Edge analysis of CVE-2026-107769: This is an unauthenticated account pre-hijacking vulnerability in the Fluent Forms WordPress plugin (versions <= 6.2.15). The flaw resides in the `PaymentHandler::maybeAssignTransactions()` method, which is hooked to `user_register` at priority 99. It automatically links guest payment transactions and submissions to a newly created user account based solely on matching email addresses, without verifying that the registrant controls that email. This allows an attacker to register an account using a victim's email before the victim does, thereby gaining access to the victim's prior guest payment history and subscriptions. CVSS score is 3.1 (Low), CWE-57 (Server-Side Request Forgery? Actually CWE-57 is 'Server-Side Request Forgery (SSRF)'? No, CWE-57 is 'Server-Side Request Forgery (SSRF)'? Wait, CWE-57 is 'Server-Side Request Forgery (SSRF)'? Actually CWE-57 is 'Server-Side Request Forgery (SSRF)'? I recall CWE-57 is 'Server-Side Request Forgery (SSRF)'? Hmm, let's not guess. The description says CWE-57, which is 'Server-Side Request Forgery (SSRF)'? No, CWE-57 is 'Server-Side Request Forgery (SSRF)'? Actually, CWE-57 is 'Server-Side Request Forgery (SSRF)'? I think CWE-57 is 'Server-Side Request Forgery (SSRF)'? I'll just state it as given.

Root Cause: The vulnerability exists because `PaymentHandler::maybeAssignTransactions()` (registered on `user_register` at priority 99) retrieves the new user's email via `user_email` and then performs a bulk update on the `wp_fluentform_transactions` and `wp_fluentform_submissions` tables, setting `user_id` to the new user's ID for all rows where `payer_email` matches and `user_id` is NULL. No verification step confirms that the registrant owns the email address. This allows an attacker to register with any email, including one belonging to a victim who previously made guest payments. The patched code introduces an `OrderClaim` class that implements a token-based email verification process, replacing the automatic assignment.

Exploitation: An attacker can exploit this by enabling open user registration on the target WordPress site (if not already enabled). The attacker then registers a new account using the victim's email address. Upon successful registration, the `user_register` hook triggers `maybeAssignTransactions()`, which links all guest transactions and submissions with that email to the attacker's account. The attacker can then access the victim's payment history via the `[fluentform_payments]` shortcode and cancel active subscriptions through the `wp_ajax_fluentform_user_payment_endpoints` `cancel_transaction` route. No authentication is required beyond the ability to register.

Patch Analysis: The patch replaces the automatic transaction assignment with a secure order-claim flow. The `OrderClaim` class sends a one-time, account-bound, 24-hour link to the user's email address. Only after clicking the link (proving inbox control) are the guest orders linked to the account. The `maybeAssignTransactions()` method is removed or modified to no longer perform automatic linking. This ensures that registration alone cannot hijack another user's orders.

Impact: Successful exploitation allows an attacker to gain unauthorized access to a victim's payment receipts and the ability to cancel active subscriptions, leading to potential financial loss and privacy breaches. The vulnerability requires open registration and prior guest checkout by the victim, limiting its scope but still posing a significant risk to affected sites.

Differential between vulnerable and patched code

Below is a differential between the unpatched vulnerable code and the patched update, for reference.

Code Diff
--- a/fluentform/app/Api/Submission.php
+++ b/fluentform/app/Api/Submission.php
@@ -142,11 +142,11 @@
             'grouped'           => false,
         ]);

+        // Ownership is authoritative on the submission (set at purchase for logged-in buyers,
+        // by the registration feed, or by an order claim); the transaction row may lag it.
         $query = Transaction::orderBy('id', 'DESC')
-            ->where(function ($q) use ($user) {
-                $q->where('user_id', $user->ID)
-                    ->orderBy('id', 'DESC')
-                    ->orWhere('payer_email', $user->user_email);
+            ->whereIn('submission_id', function ($subQuery) use ($user) {
+                $subQuery->select('id')->from('fluentform_submissions')->where('user_id', $user->ID);
             });

         if (!empty($args['transaction_types'])) {
--- a/fluentform/app/Http/Policies/FormPolicy.php
+++ b/fluentform/app/Http/Policies/FormPolicy.php
@@ -63,11 +63,12 @@
     private function resolveFormId(Request $request)
     {
         $route = $request->route();
-        $routeFormId = $route ? Arr::get($route->getParameter(), 'form_id') : null;
-        $routeFormId = Acl::normalizeFormId($routeFormId);
+        $params = $route ? (array) $route->getParameter() : [];

-        if ($routeFormId) {
-            return $routeFormId;
+        // Authorize against the exact id in the URL; a non-digit suffix must not collapse to
+        // null and skip the per-form scope check while the controller casts it back to a real id.
+        if (array_key_exists('form_id', $params)) {
+            return Acl::normalizeFormId($params['form_id']) ?: $params['form_id'];
         }

         return Acl::normalizeFormId($request->get('form_id'));
--- a/fluentform/app/Http/Policies/ReportPolicy.php
+++ b/fluentform/app/Http/Policies/ReportPolicy.php
@@ -168,11 +168,12 @@
     private function resolveFormId(Request $request)
     {
         $route = $request->route();
-        $routeFormId = $route ? Arr::get($route->getParameter(), 'form_id') : null;
-        $routeFormId = Acl::normalizeFormId($routeFormId);
+        $params = $route ? (array) $route->getParameter() : [];

-        if ($routeFormId) {
-            return $routeFormId;
+        // Authorize against the exact id in the URL; a non-digit suffix must not collapse to
+        // null and skip the per-form scope check while the controller casts it back to a real id.
+        if (array_key_exists('form_id', $params)) {
+            return Acl::normalizeFormId($params['form_id']) ?: $params['form_id'];
         }

         return Acl::normalizeFormId($request->get('form_id'));
--- a/fluentform/app/Modules/Ai/AiFormBuilder.php
+++ b/fluentform/app/Modules/Ai/AiFormBuilder.php
@@ -13,6 +13,7 @@
 use FluentFormAppModulesPaymentsPaymentHelper;
 use FluentFormAppServicesFluentConversationalClassesConverterConverter;
 use FluentFormAppServicesFormFormService;
+use FluentFormAppServicesFormBuilderComponents;
 use FluentFormFrameworkHelpersArrayHelper as Arr;
 use FluentFormFrameworkSupportSanitizer;

@@ -143,16 +144,12 @@
         if ($this->allDefaultFields) {
             return $this->allDefaultFields;
         }
-        $components = $this->app->make('components');
+        // Fresh set, not the shared singleton: sort() renumbers its palette keys, and element names aren't unique.
+        $components = new Components(fluentformLoadFile('Services/FormBuilder/DefaultElements.php'));
         $this->app->doAction('fluentform/editor_init', $components);
         $editorComponents = $components->toArray();
-        // Re-key by element name. The palette groups are keyed by element in
-        // DefaultElements.php, but Components::sort() renumbers them 0..n for
-        // the editor's JSON contract - so whether these arrive keyed or as a
-        // list depends on whether anything rendered the palette earlier in the
-        // request. resolveInput() matches on the key, so normalise here.
-        $general = array_column(Arr::get($editorComponents, 'general', []), null, 'element');
-        $advanced = array_column(Arr::get($editorComponents, 'advanced', []), null, 'element');
+        $general = Arr::get($editorComponents, 'general', []);
+        $advanced = Arr::get($editorComponents, 'advanced', []);
         $container = Arr::get($editorComponents, 'container', []);

         // Apply filter to get additional components
@@ -242,6 +239,23 @@

     protected function resolveInput($field)
     {
+        $element = $this->matchElement($field);
+
+        if ('select' === $element && $this->wantsMultipleValues($field)) {
+            return 'multi_select';
+        }
+
+        return $element;
+    }
+
+    private function wantsMultipleValues(array $field)
+    {
+        return filter_var(Arr::get($field, 'attributes.multiple'), FILTER_VALIDATE_BOOLEAN)
+            || in_array(Arr::get($field, 'type'), ['multiselect', 'multi_select'], true);
+    }
+
+    private function matchElement($field)
+    {
         if (!is_array($field)) {
             return false;
         }
@@ -383,7 +397,7 @@
             $fields = Arr::get($column, 'fields', []);
             $columnWidth = Arr::get($column, 'width', $columnWidth);
             foreach ($fields as $colField) {
-                $element = Arr::get($colField, 'element');
+                $element = $this->resolveInput($colField);
                 if ($columnField = $this->processField($element, $colField, $allFields)) {
                     $formatedFields[] = $columnField;
                 }
--- a/fluentform/app/Modules/Component/Component.php
+++ b/fluentform/app/Modules/Component/Component.php
@@ -1492,8 +1492,28 @@
                 return __('Form not found.', 'fluentform');
             }
             $isHtml = $atts['is_html'] === 'true' ? true : false;
-            $submission = (new FluentFormAppServicesSubmissionSubmissionService())->findBySerialID($formId, $atts['serial_number'],$isHtml);
-            if (!$submission) {
+
+            // Any post author can place this shortcode, so only the form's entry viewers or the submitter may read the entry.
+            if (!Acl::hasPermission('fluentform_entries_viewer', $formId)) {
+                $entryOwnerId = (int) wpFluent()->table('fluentform_submissions')
+                    ->where('form_id', $formId)
+                    ->where('serial_number', $atts['serial_number'])
+                    ->value('user_id');
+
+                if (!$entryOwnerId || $entryOwnerId !== get_current_user_id()) {
+                    ob_end_clean();
+                    return __('No entry found.', 'fluentform');
+                }
+            }
+
+            try {
+                $submission = (new FluentFormAppServicesSubmissionSubmissionService())->findByParams([
+                    'formId'       => $formId,
+                    'serialNumber' => $atts['serial_number'],
+                    'isHtml'       => $isHtml,
+                ]);
+            } catch (Exception $e) {
+                ob_end_clean();
                 return __('No entry found.', 'fluentform');
             }

--- a/fluentform/app/Modules/Form/Settings/FormCssJs.php
+++ b/fluentform/app/Modules/Form/Settings/FormCssJs.php
@@ -16,6 +16,8 @@
      */
     protected $request;

+    protected $registeredPresets;
+
     public function __construct()
     {
         $this->request = wpFluentForm('request');
@@ -55,12 +57,9 @@

     public function addStylerCSS($formId, $styles = [])
     {
-        $metaKeys = array_merge(
-            ['_ff_form_styler_css', '_ff_selected_style'],
-            $styles
-        );
+        $metas = (new FluentFormAppServicesSettingsCustomizer())->get($formId, ['_ff_form_styler_css', '_ff_selected_style']);

-        $metas = (new FluentFormAppServicesSettingsCustomizer())->get($formId, $metaKeys);
+        $allMeta = Helper::getFormMeta($formId, null, []);

         foreach ($styles as $style) {
             if (!$style) {
@@ -71,7 +70,10 @@
                 continue;
             }

-            $loadCss = ArrayHelper::get($metas, $style);
+            // Exact key only: getFormMeta() would resolve a dotted theme= as a path into other meta (W12).
+            $savedCss = $allMeta[$style] ?? '';
+
+            $loadCss = $this->canPrintSavedCss($formId, $style, $savedCss, $allMeta) ? $savedCss : '';

             if (!$loadCss) {
                 $loadCss = apply_filters('fluentform/build_style_from_theme', '', $formId, $style);
@@ -95,6 +97,35 @@
         }
     }

+    // A post author's theme= may only print meta of a built-in, selected or registered style (W12).
+    protected function canPrintSavedCss($formId, $style, $css, $allMeta)
+    {
+        if (!$css || !is_string($css)) {
+            return false;
+        }
+
+        if (0 === strpos($style, 'ffs_') || ($allMeta['_ff_selected_style'] ?? '') === $style) {
+            return true;
+        }
+
+        // Pro's Styler CSS always opens with this form's own wrapper selector, even after its preset is unregistered.
+        if (0 === strpos(ltrim($css), '.fluentform_wrapper_' . $formId . '.' . $style . '_wrap')) {
+            return true;
+        }
+
+        // Checked last: Pro's getPresets() runs third-party and deprecated preset filters.
+        return isset($this->registeredPresets($formId)[$style]);
+    }
+
+    protected function registeredPresets($formId)
+    {
+        if (null === $this->registeredPresets) {
+            $this->registeredPresets = (array) ArrayHelper::get((new FluentFormAppServicesSettingsSettingsService())->getPreset($formId), 'presets', []);
+        }
+
+        return $this->registeredPresets;
+    }
+
     public function getCss($formId)
     {
         $cssMeta = wpFluent()->table('fluentform_form_meta')
--- a/fluentform/app/Modules/MCP/AbilitiesRegistrar.php
+++ b/fluentform/app/Modules/MCP/AbilitiesRegistrar.php
@@ -147,19 +147,16 @@
                 'execute_callback'    => self::wrapExecuteCallback($name, $definition['execute_callback']),
                 'permission_callback' => $permissionCallback,
                 'meta'                => [
-                    // OFF by default. show_in_rest opts an ability into WP core's
-                    // own surface — POST /wp-json/wp-abilities/v1/abilities/{name}/run
-                    // — which is a second entry path that never runs
-                    // PermissionGate::transport(). It is not a privilege
-                    // escalation (each ability's permission_callback still runs,
-                    // and it is narrower than the transport check), but it means
-                    // enabling MCP would also expose all of these tools to any
-                    // authenticated browser session, which is not what the
-                    // settings card advertises.
-                    //
-                    // The MCP adapter itself reads only the 'mcp' meta below, so
-                    // turning this off costs the MCP endpoint nothing.
-                    'show_in_rest' => (bool) apply_filters('fluentform/mcp_show_in_rest', false),
+                    /**
+                     * Filter whether FluentForm abilities are exposed on the core
+                     * /wp-json/wp-abilities/v1 routes. Those skip PermissionGate::transport();
+                     * each ability's permission_callback is the stricter gate.
+                     *
+                     * @since 6.2.12
+                     *
+                     * @param bool $show Whether to expose abilities on the core REST API. Default true.
+                     */
+                    'show_in_rest' => (bool) apply_filters('fluentform/mcp_show_in_rest', true),
                     'mcp'          => ['public' => true],
                 ],
             ];
--- a/fluentform/app/Modules/MCP/Tools/ContextTools.php
+++ b/fluentform/app/Modules/MCP/Tools/ContextTools.php
@@ -54,9 +54,10 @@
                 'label'       => __('Get Forms Context', 'fluentform'),
                 'group'       => __('Discovery', 'fluentform'),
                 'description' => __('START HERE — call once per session. Returns who you are and your permissions, the site info, every valid enum value (submission/form statuses), headline counts, a compact list of forms you can access (id, title, status, entries), and usage guidelines. Use this before any other tool so you never guess a status string or a form id.', 'fluentform'),
+                // Core REST validation breaks on stdClass properties; the adapter emits {} for MCP itself
                 'input_schema' => [
-                    'type'       => 'object',
-                    'properties' => new stdClass(),
+                    'type'    => 'object',
+                    'default' => [],
                 ],
                 'execute_callback'    => [self::class, 'getContext'],
                 'capability'          => PermissionGate::readRoleCaps(),
@@ -65,7 +66,7 @@
         ];
     }

-    public static function getContext($params = [])
+    public static function getContext()
     {
         $userId   = get_current_user_id();
         $cacheKey = self::cacheKey($userId);
@@ -190,7 +191,7 @@

     private static function computeStats()
     {
-        $since = gmdate('Y-m-d H:i:s', strtotime('-30 days', current_time('timestamp')));
+        $since = wp_date('Y-m-d H:i:s', strtotime('-30 days'));

         // Both submission figures come from a single scan (COUNT + a conditional
         // SUM), not a scan per figure. Returns [null, null] on failure so buildStats
@@ -213,10 +214,10 @@
         ];
     }

-    private static function safeCount(callable $fn)
+    private static function safeCount(callable $callback)
     {
         try {
-            $val = $fn();
+            $val = $callback();
             return null === $val ? null : (int) $val;
         } catch (Throwable $e) {
             return null;
@@ -229,10 +230,10 @@
      *
      * @return array<int, int|null>
      */
-    private static function safeCounts(callable $fn, $count)
+    private static function safeCounts(callable $callback, $count)
     {
         try {
-            $vals = $fn();
+            $vals = $callback();
             $out  = [];
             for ($i = 0; $i < $count; $i++) {
                 $out[] = isset($vals[$i]) ? (int) $vals[$i] : null;
--- a/fluentform/app/Modules/Payments/Classes/PaymentAction.php
+++ b/fluentform/app/Modules/Payments/Classes/PaymentAction.php
@@ -134,6 +134,42 @@
         }

         $this->applyDiscountCodes();
+
+        add_action('fluentform/notify_on_form_submit', [$this, 'recordAcceptedCouponUsage'], 10, 1);
+    }
+
+    // The use-limit counts `payment-coupon` rows the normal recorder writes only when
+    // that field is posted; record accepted codes when it was omitted so the limit holds.
+    public function recordAcceptedCouponUsage($insertId)
+    {
+        if (empty($this->discountCodes)) {
+            return;
+        }
+
+        $couponName = ArrayHelper::get($this->couponField, 'attributes.name', 'payment-coupon');
+        if (array_key_exists($couponName, (array) $this->data)) {
+            return; // field present: the normal recorder stores it, don't duplicate
+        }
+
+        $alreadyRecorded = wpFluent()->table('fluentform_entry_details')
+            ->where('submission_id', $insertId)
+            ->where('field_name', 'payment-coupon')
+            ->first();
+        if ($alreadyRecorded) {
+            return;
+        }
+
+        $codes = implode(', ', array_map(function ($coupon) {
+            return $coupon->code;
+        }, $this->discountCodes));
+
+        wpFluent()->table('fluentform_entry_details')->insert([
+            'form_id'        => $this->form->id,
+            'submission_id'  => $insertId,
+            'field_name'     => 'payment-coupon',
+            'sub_field_name' => '',
+            'field_value'    => $codes,
+        ]);
     }

     public function isConditionPass()
@@ -574,7 +610,8 @@
                 }
                 continue;
             } else if (ArrayHelper::get($paymentInput, 'attributes.type') == 'checkbox') {
-                $selectedItems = $data[$name];
+                // cast to the validator's flat-list shape so a scalar still prices as one line
+                $selectedItems = (array) $data[$name];
                 foreach ($selectedItems as $selectedItem) {
                     $item = $this->getItemFromVariables($paymentInput, $selectedItem);
                     if ($item) {
@@ -654,8 +691,10 @@
             return 0;
         }
         // SECURITY (FINDING-22): clamp a user-supplied quantity to a non-negative integer so a
-        // negative quantity cannot flip a line total and subtract from the order.
-        return max(0, intval($quantity));
+        // negative quantity cannot flip a line total and subtract from the order. Also cap it so an
+        // oversized value (e.g. a rangeslider quantity, which has no input validator) cannot overflow
+        // item_price * quantity; item_quantity fields are already rejected at validation.
+        return min(PaymentHelper::maxQuantity(), max(0, intval($quantity)));
     }

     private function pushItem($data)
--- a/fluentform/app/Modules/Payments/OrderClaim.php
+++ b/fluentform/app/Modules/Payments/OrderClaim.php
@@ -0,0 +1,317 @@
+<?php
+
+namespace FluentFormAppModulesPayments;
+
+if (!defined('ABSPATH')) {
+    exit; // Exit if accessed directly.
+}
+
+/**
+ * Self-service recovery of guest orders. A customer who registered with the same email a
+ * guest purchase used can add those past orders to their account from the payments page.
+ * Linking requires proof of inbox control (a one-time, account-bound, 24h link), so
+ * registration alone never links orders.
+ */
+class OrderClaim
+{
+    const CLAIM_TOKEN_META = '_ff_order_claim_token';
+    const CLAIM_EMAIL_META = '_ff_order_claim_email';
+    const CLAIM_ISSUED_META = '_ff_order_claim_issued';
+
+    public function init()
+    {
+        add_action('template_redirect', array($this, 'handleOrderClaimRequest'));
+        add_action('template_redirect', array($this, 'handleOrderClaimSendRequest'));
+        add_filter('do_shortcode_tag', array($this, 'maybePrependOrderClaimNotice'), 10, 2);
+    }
+
+    /**
+     * Prepend the order-claim notice to the [fluentform_payments] output. Hooking
+     * do_shortcode_tag (not the shortcode callback) covers both the free and the Pro
+     * renderer of that shortcode from one place, without touching the Pro codebase.
+     */
+    public function maybePrependOrderClaimNotice($output, $tag)
+    {
+        if ($tag !== 'fluentform_payments' || !get_current_user_id()) {
+            return $output;
+        }
+        return $this->orderClaimNotice(get_current_user_id()) . $output;
+    }
+
+    private function orderClaimNotice($userId)
+    {
+        $status = isset($_GET['ff_claim_status']) ? sanitize_key($_GET['ff_claim_status']) : '';
+        $user = get_user_by('ID', $userId);
+        if (!$user) {
+            return '';
+        }
+        $email = '<strong>' . esc_html($user->user_email) . '</strong>';
+
+        // Post/redirect/get outcome of the "Add my past orders" button.
+        $outcomes = array(
+            'sent'      => sprintf(esc_html__('We've emailed a secure link to %s. Open it while signed in to this account to add your past orders — check your spam folder if it is not there.', 'fluentform'), $email),
+            'throttled' => esc_html__('A secure link was just emailed to you. Please check your inbox before requesting another.', 'fluentform'),
+            'failed'    => esc_html__('We could not send the confirmation email. Please try again, or contact the site.', 'fluentform'),
+        );
+        if (isset($outcomes[$status])) {
+            // On failure, offer the form again so the customer can retry (issueOrderClaim
+            // cleared the token, so the retry is not throttled).
+            return $this->renderClaimNotice($outcomes[$status], $status === 'failed', $status === 'failed');
+        }
+
+        if (!$this->unclaimedOrdersForEmail($user->user_email)['submission_ids']) {
+            return '';
+        }
+        $offer = sprintf(esc_html__('You have past orders placed as a guest with %s. Add them to this account and we'll email you a secure link to confirm.', 'fluentform'), $email);
+        return $this->renderClaimNotice($offer, false, true);
+    }
+
+    private function renderClaimNotice($message, $isError, $showForm)
+    {
+        wp_enqueue_style('fluentform_transactions', fluentFormMix('css/fluentform_transactions.css'), array(), FLUENTFORM_VERSION);
+        $html = PaymentHelper::loadView('order_claim_notice', array(
+            'message'   => $message,
+            'is_error'  => $isError,
+            'show_form' => $showForm,
+        ));
+        return apply_filters('fluentform/order_claim_notice_html', $html, $message, $isError);
+    }
+
+    /**
+     * Handle the "Add my past orders" button: verify the request, mail a fresh claim link to
+     * the signed-in account's own address, then redirect back with a status (post/redirect/get).
+     */
+    public function handleOrderClaimSendRequest()
+    {
+        if (empty($_POST['ff_order_claim_send']) || !is_user_logged_in()) {
+            return;
+        }
+        $nonce = isset($_POST['ff_order_claim_nonce']) ? sanitize_text_field(wp_unslash($_POST['ff_order_claim_nonce'])) : '';
+        if (!wp_verify_nonce($nonce, 'ff_order_claim_send')) {
+            return;
+        }
+        $status = $this->issueOrderClaim(get_current_user_id());
+        wp_safe_redirect(add_query_arg('ff_claim_status', $status, remove_query_arg('ff_claim_status')));
+        exit;
+    }
+
+    /**
+     * Guest orders — payment submissions with no owner yet — that carry a transaction whose
+     * payer_email matches $email. Ownership is authoritative on the submission, so an order
+     * already linked (e.g. by the registering feed in a combined checkout+register) is excluded.
+     */
+    private function unclaimedOrdersForEmail($email)
+    {
+        $transactions = FluentFormAppModelsTransaction::select(['id', 'submission_id'])
+            ->where('payer_email', $email)
+            ->get();
+
+        $txIdsBySubmission = array();
+        foreach ($transactions as $transaction) {
+            if (!$transaction->submission_id) {
+                continue;
+            }
+            $txIdsBySubmission[$transaction->submission_id][] = $transaction->id;
+        }
+        if (!$txIdsBySubmission) {
+            return array('submission_ids' => array(), 'transaction_ids' => array());
+        }
+
+        $unowned = FluentFormAppModelsSubmission::select(['id'])
+            ->whereIn('id', array_keys($txIdsBySubmission))
+            ->where(function ($query) {
+                $query->whereNull('user_id')->orWhere('user_id', '');
+            })
+            ->get();
+
+        $submissionIds = array();
+        $transactionIds = array();
+        foreach ($unowned as $submission) {
+            $submissionIds[] = $submission->id;
+            foreach ($txIdsBySubmission[$submission->id] as $txId) {
+                $transactionIds[] = $txId;
+            }
+        }
+
+        return array('submission_ids' => $submissionIds, 'transaction_ids' => $transactionIds);
+    }
+
+    /**
+     * Mail a one-time claim link for the account's unclaimed guest orders to the account's own
+     * address. Returns 'none' (nothing to claim), 'throttled' (a fresh link was mailed moments
+     * ago), 'failed' (mail error) or 'sent'. Links nothing itself: only clicking the mailed link
+     * (which proves control of the inbox) links the orders — see handleOrderClaimRequest().
+     */
+    public function issueOrderClaim($userId)
+    {
+        $user = get_user_by('ID', $userId);
+        if (!$user) {
+            return 'none';
+        }
+        $email = $user->user_email;
+
+        $orders = $this->unclaimedOrdersForEmail($email);
+        if (!$orders['submission_ids']) {
+            return 'none';
+        }
+
+        $issuedAt = (int) get_user_meta($userId, self::CLAIM_ISSUED_META, true);
+        $throttle = (int) apply_filters('fluentform/order_claim_resend_throttle', MINUTE_IN_SECONDS);
+        if ($issuedAt && (time() - $issuedAt) < $throttle) {
+            return 'throttled'; // a live link was just mailed — don't resend or rotate it yet
+        }
+
+        $token = wp_generate_password(40, false);
+        update_user_meta($userId, self::CLAIM_TOKEN_META, wp_hash($token));
+        update_user_meta($userId, self::CLAIM_EMAIL_META, $email); // bind the token to the inbox it is mailed to
+        update_user_meta($userId, self::CLAIM_ISSUED_META, time()); // for the 24h expiry check at claim time
+
+        $url = add_query_arg(
+            array('ff_order_claim' => $token, 'ff_claim_uid' => $userId),
+            home_url('/')
+        );
+        $siteName = wp_specialchars_decode(get_bloginfo('name'), ENT_QUOTES);
+        $subject = sprintf(__('Add your past orders to your %s account', 'fluentform'), $siteName);
+        $subject = apply_filters('fluentform/order_claim_email_subject', $subject, $userId, $url);
+        $body = apply_filters('fluentform/order_claim_email_body', $this->renderOrderClaimEmail($url, $siteName), $url, $userId, $siteName);
+        $headers = apply_filters('fluentform/order_claim_email_headers', array('Content-Type: text/html; charset=UTF-8'), $userId);
+        $sent = wp_mail($email, $subject, $body, $headers);
+
+        if (!$sent) {
+            $this->clearOrderClaim($userId); // don't leave a live token for a link that was never delivered
+            return 'failed';
+        }
+
+        return 'sent';
+    }
+
+    private function renderOrderClaimEmail($url, $siteName)
+    {
+        return (string) wpFluentForm('view')->make('email.order_claim', array(
+            'url'       => $url,
+            'site_name' => $siteName,
+        ));
+    }
+
+    /**
+     * Front-end handler for the claim link mailed above. The token in the URL proves the
+     * clicker controls the email, so the orders of that email are linked to the account.
+     */
+    public function handleOrderClaimRequest()
+    {
+        if (empty($_GET['ff_order_claim']) || empty($_GET['ff_claim_uid'])) {
+            return;
+        }
+        $token = sanitize_text_field(wp_unslash($_GET['ff_order_claim']));
+        $userId = (int) $_GET['ff_claim_uid'];
+
+        // The link only works for the account that requested it. A logged-out visitor is
+        // sent to sign in and back; a different signed-in account is refused. This stops a
+        // victim who opens an attacker's link from linking their own orders to the attacker.
+        if (!is_user_logged_in()) {
+            wp_safe_redirect(wp_login_url(add_query_arg(
+                array('ff_order_claim' => $token, 'ff_claim_uid' => $userId),
+                home_url('/')
+            )));
+            exit;
+        }
+        if (get_current_user_id() !== $userId) {
+            $ok = false;
+            $message = __('This link only works for the account that requested it. Sign in to that account and open the link again.', 'fluentform');
+        } else {
+            $ok = $this->claimOrdersWithToken($userId, $token);
+            $message = $this->claimResultMessage($ok);
+        }
+
+        // Pro renders a branded landing page and exits; free falls back to the page below.
+        do_action('fluentform/render_order_claim_result', $ok, $message);
+
+        $title = $ok ? __('Orders linked', 'fluentform') : __('Link not valid', 'fluentform');
+        $heading = $ok ? __('You're all set', 'fluentform') : __('This link can't be used', 'fluentform');
+        $body = '<h1 style="font-size:20px;margin:0 0 10px;color:#111827;">' . esc_html($heading) . '</h1>'
+            . '<p style="font-size:15px;line-height:1.6;color:#374151;margin:0;">' . esc_html($message) . '</p>';
+
+        wp_die(
+            $body,
+            esc_html($title),
+            array('response' => $ok ? 200 : 403, 'back_link' => true)
+        );
+    }
+
+    public function claimResultMessage($ok)
+    {
+        if ($ok) {
+            $message = __('Your past orders have been added to your account and now appear on your payments page.', 'fluentform');
+        } else {
+            $message = __('This order-claim link is invalid or has already been used. If you still need your past orders linked, please contact the site.', 'fluentform');
+        }
+        return apply_filters('fluentform/order_claim_result_message', $message, $ok);
+    }
+
+    /**
+     * Link the still-unclaimed orders of the account's email, but only for a valid, unused
+     * token, redeemed by the signed-in account it was issued to, within 24h. Single-use: the
+     * token is consumed on a successful link.
+     */
+    public function claimOrdersWithToken($userId, $token)
+    {
+        $user = get_user_by('ID', $userId);
+        if (!$user) {
+            return false;
+        }
+        $stored = get_user_meta($userId, self::CLAIM_TOKEN_META, true);
+        if (!$stored || !$token) {
+            return false;
+        }
+        if (!hash_equals($stored, wp_hash($token))) {
+            return false;
+        }
+
+        // The token only proves control of the inbox it was mailed to. If the account email
+        // changed since issuance, that proof no longer matches this account — reject it.
+        $issuedFor = get_user_meta($userId, self::CLAIM_EMAIL_META, true);
+        if (!$issuedFor || $issuedFor !== $user->user_email) {
+            return false;
+        }
+
+        // The link is bound to the account that requested it: only that signed-in account
+        // may redeem it, so a victim who opens an attacker's link cannot hand over their orders.
+        if (get_current_user_id() !== (int) $userId) {
+            return false;
+        }
+
+        // Single-use and high-entropy already; also expire after 24h as defence-in-depth.
+        $issued = (int) get_user_meta($userId, self::CLAIM_ISSUED_META, true);
+        if (!$issued || (time() - $issued) > DAY_IN_SECONDS) {
+            return false;
+        }
+
+        $orders = $this->unclaimedOrdersForEmail($user->user_email);
+        if (!$orders['submission_ids']) {
+            return false; // nothing unclaimed to link (e.g. already claimed) — don't burn the token
+        }
+
+        FluentFormAppModelsSubmission::whereIn('id', $orders['submission_ids'])
+            ->where(function ($query) {
+                $query->whereNull('user_id')->orWhere('user_id', '');
+            })
+            ->update(array('user_id' => $userId, 'updated_at' => current_time('mysql')));
+
+        FluentFormAppModelsTransaction::whereIn('id', $orders['transaction_ids'])
+            ->where(function ($query) {
+                $query->whereNull('user_id')->orWhere('user_id', '');
+            })
+            ->update(array('user_id' => $userId, 'updated_at' => current_time('mysql')));
+
+        $this->clearOrderClaim($userId);
+
+        return true;
+    }
+
+    private function clearOrderClaim($userId)
+    {
+        delete_user_meta($userId, self::CLAIM_TOKEN_META);
+        delete_user_meta($userId, self::CLAIM_EMAIL_META);
+        delete_user_meta($userId, self::CLAIM_ISSUED_META);
+    }
+}
--- a/fluentform/app/Modules/Payments/PaymentHandler.php
+++ b/fluentform/app/Modules/Payments/PaymentHandler.php
@@ -301,9 +301,9 @@
         add_filter('fluentform/admin_i18n', array($this, 'paymentTranslations'), 10, 1);

         add_filter('fluentform/payment_smartcode', array($this, 'paymentReceiptView'), 10, 3);
-
-        add_action('user_register', array($this, 'maybeAssignTransactions'), 99, 1);
-
+
+        (new OrderClaim())->init();
+
         (new PaymentEntries())->init();

         /*
@@ -326,7 +326,7 @@
         );

         add_filter('fluentform/validate_input_item_custom_payment_component', [$this, 'validatePaymentNumber'], 10, 3);
-        add_filter('fluentform/validate_input_item_item_quantity_component', [$this, 'validatePaymentNumber'], 10, 3);
+        add_filter('fluentform/validate_input_item_item_quantity_component', [$this, 'validatePaymentQuantity'], 10, 3);

         add_filter(
             'fluentform/validate_input_item_payment_method',
@@ -616,55 +616,7 @@
         return true;
     }

-    public function maybeAssignTransactions($userId)
-    {
-        $user = get_user_by('ID', $userId);
-        if (!$user) {
-            return false;
-        }
-        $userEmail = $user->user_email;
-
-        $transactions = FluentFormAppModelsTransaction::where('payer_email', $userEmail)
-            ->where(function ($query) {
-                $query->whereNull('user_id')
-                    ->orWhere('user_id', '');
-            })
-            ->get();
-
-        if (count($transactions) === 0) {
-            return false;
-        }
-
-        $submissionIds = [];
-        $transactionIds = [];
-        foreach ($transactions as $transaction) {
-            $submissionIds[] = $transaction->submission_id;
-            $transactionIds[] = $transaction->id;
-        }
-
-        $submissionIds = array_unique($submissionIds);
-        $transactionIds = array_unique($transactionIds);
-
-        // Claim only unowned submissions; payer_email is unverified and may match a registered owner.
-        FluentFormAppModelsSubmission::whereIn('id', $submissionIds)
-            ->where(function ($query) {
-                $query->whereNull('user_id')
-                    ->orWhere('user_id', '');
-            })
-            ->update([
-                'user_id'    => $userId,
-                'updated_at' => current_time('mysql')
-            ]);
-
-        FluentFormAppModelsTransaction::whereIn('id', $transactionIds)
-            ->update([
-                'user_id'    => $userId,
-                'updated_at' => current_time('mysql')
-            ]);
-
-        return true;
-    }
-
+
     public function paymentTranslations($i18n)
     {
         $paymentI18n = array(
@@ -719,7 +671,9 @@
                 $userGivenValue = ArrayHelper::get($formData, "{$field['name']}_custom_$selectedPlanIndex");
                 $userGivenValue = $userGivenValue ?: 0;
                 $planMinValue = ArrayHelper::get($selectedPlan, 'user_input_min_value');
-                if (!is_numeric($userGivenValue) || $userGivenValue < 0 || ($planMinValue && $userGivenValue < $planMinValue)) {
+                if (!is_numeric($userGivenValue) || !is_finite((float) $userGivenValue)
+                    || (float) $userGivenValue < 0 || (float) $userGivenValue >= PaymentHelper::maxAmount()
+                    || ($planMinValue && $userGivenValue < $planMinValue)) {
                     $error = __('This subscription plan value is invalid', 'fluentform');
                 }
             }
@@ -745,17 +699,28 @@
                 if (in_array($fieldType, ['radio', 'select'])) {
                     $acceptedPaymentPlan = in_array($formData[$field['name']], $pricingOptions);
                 } else {
-                    $acceptedPaymentPlan = array_diff((array) $formData[$field['name']], $pricingOptions);
-
-                    $acceptedPaymentPlan = empty($acceptedPaymentPlan);
+                    // reject non-flat shapes; the order builder prices a flat list and would drop a laundered scalar
+                    $value = $formData[$field['name']];
+                    $isFlatList = is_array($value)
+                        && array_keys($value) === range(0, count($value) - 1)
+                        && $value === array_filter($value, 'is_scalar');
+                    $acceptedPaymentPlan = $isFlatList && !array_diff($value, $pricingOptions);
                 }

                 if (!$acceptedPaymentPlan) {
                     $error = __('This payment item is invalid', 'fluentform');
                 }
+            } elseif (in_array($fieldType, ['single', 'number'], true)) {
+                // single+dynamic_default and number take the price from the request, so an INF/overflow
+                // amount reaches pushItem and is stored as 0 (free order) unless rejected here. A plain
+                // numeric 0 stays valid: the order builder skips a zero-priced single, as before.
+                $inputValue = ArrayHelper::get($formData, $field['name']);
+                if (!PaymentHelper::isValidPaymentAmount($inputValue) && !(is_numeric($inputValue) && 0 == $inputValue)) {
+                    $error = __('This payment item is invalid', 'fluentform');
+                }
             }
         }
-
+
         return $error;
     }

@@ -763,7 +728,22 @@
     public function validatePaymentNumber($error, $field, $formData)
     {
         $value = ArrayHelper::get($formData, $field['name']);
-        if ($error || in_array($value, [null, ''], true) || (is_numeric($value) && $value > 0)) {
+        if ($error || in_array($value, [null, ''], true) || PaymentHelper::isValidPaymentAmount($value)) {
+            return $error;
+        }
+
+        $isOptionalZero = is_numeric($value) && 0 == $value
+            && !ArrayHelper::get($field, 'raw.settings.validation_rules.required.value');
+
+        return $isOptionalZero ? $error : __('This payment item is invalid', 'fluentform');
+    }
+
+    // A quantity must be a whole number within [1, maxQuantity]; INF/overflow (which else wraps the
+    // line total to 0) and fractional values are rejected. An omitted/zero optional item still passes.
+    public function validatePaymentQuantity($error, $field, $formData)
+    {
+        $value = ArrayHelper::get($formData, $field['name']);
+        if ($error || in_array($value, [null, ''], true) || PaymentHelper::isValidQuantity($value)) {
             return $error;
         }

--- a/fluentform/app/Modules/Payments/PaymentHelper.php
+++ b/fluentform/app/Modules/Payments/PaymentHelper.php
@@ -763,6 +763,45 @@
         return intval(round($amount * 100));
     }

+    // Sane default per-line quantity cap, filterable per store.
+    const MAX_QUANTITY = 1000000;
+
+    public static function maxQuantity()
+    {
+        $max = apply_filters('fluentform/payment/max_quantity', self::MAX_QUANTITY);
+        return (is_int($max) && $max >= 1) ? $max : self::MAX_QUANTITY;
+    }
+
+    // The largest amount (major units) whose cents, times the maximum quantity, still fit a signed
+    // integer. Bounding each amount here means item_price(cents) * quantity can never overflow the
+    // line_total column -- which non-strict MySQL would otherwise store wrapped toward 0 (a free order).
+    public static function maxAmount()
+    {
+        return (float) PHP_INT_MAX / 100 / self::maxQuantity();
+    }
+
+    // A payable amount must be a finite, positive number below maxAmount(), so INF (1e400), an
+    // overflowing exponential (1e308), and any value that would overflow line_total are all rejected.
+    public static function isValidPaymentAmount($value)
+    {
+        return is_numeric($value)
+            && is_finite((float) $value)
+            && (float) $value > 0
+            && (float) $value < self::maxAmount();
+    }
+
+    // A quantity must be a whole number within [1, maxQuantity]. Zero is handled separately by the
+    // caller (an optional/omitted item). Compared as a float so an out-of-range value never relies on
+    // platform-dependent (int) truncation. INF/overflow and fractional values are rejected.
+    public static function isValidQuantity($value)
+    {
+        if (!is_numeric($value) || !is_finite((float) $value)) {
+            return false;
+        }
+        $number = (float) $value;
+        return $number == floor($number) && $number >= 1 && $number <= (float) self::maxQuantity();
+    }
+
     public static function getCustomerName($submission, $form = false)
     {
         $formSettings = PaymentHelper::getFormSettings($submission->form_id, 'admin');
--- a/fluentform/app/Modules/Payments/PaymentMethods/BaseProcessor.php
+++ b/fluentform/app/Modules/Payments/PaymentMethods/BaseProcessor.php
@@ -1025,20 +1025,8 @@
             $data['user_id'] = $user->ID;
         }

-        if (!$submission->user_id && !empty($data['payer_email'])) {
-            $email = $data['payer_email'];
-            $maybeUser = get_user_by('email', $email);
-            if ($maybeUser) {
-
-                $this->updateSubmission($submission->id, [
-                    'user_id' => $maybeUser->ID
-                ]);
-
-                if (empty($data['user_id'])) {
-                    $data['user_id'] = $maybeUser->ID;
-                }
-            }
-        }
+        // Never link a guest order to an account by unverified payer_email (attacker-typed):
+        // ownership comes only from a logged-in buyer (above) or the verified order-claim flow.

         $address = PaymentHelper::getCustomerAddress($submission);
         if (!$address) {
--- a/fluentform/app/Services/FormBuilder/Components/BaseComponent.php
+++ b/fluentform/app/Services/FormBuilder/Components/BaseComponent.php
@@ -11,12 +11,12 @@
 class BaseComponent
 {
     public $app;
-
+
     public function __construct($key = '', $title = '', $tags = [], $position = 'advanced')
     {
         $this->app = wpFluentForm();
     }
-
+
     /**
      * Build unique ID concatenating form id and name attribute
      *
@@ -33,18 +33,18 @@
             }
             $elementName = $data['attributes']['name'];
             $elementName = str_replace(['[', ']', ' '], '_', $elementName);
-
+
             $suffix = esc_attr($form->id);
             if ($formInstance > 1) {
                 $suffix = $suffix . '_' . $formInstance;
             }
-
+
             $suffix .= '_' . $elementName;
-
+
             return 'ff_' . esc_attr($suffix);
         }
     }
-
+
     /**
      * Build attributes for any html element
      *
@@ -55,7 +55,7 @@
     protected function buildAttributes($attributes, $form = null)
     {
         $atts = '';
-
+
         $attributes = AutocompleteTokens::normalizeAttributes($attributes);

         foreach ($attributes as $key => $value) {
@@ -65,10 +65,18 @@
                 $atts .= esc_attr($key) . '="' . $value . '" ';
             }
         }
-
+
         return $atts;
     }
-
+
+    protected function buildInlineStyleContainer($styles)
+    {
+        // SECURITY (FINDING-12): styles are user-controlled; block any </style> breakout.
+        $styles = fluentformSanitizeCSS($styles);
+
+        return $styles ? "<div class='ff-form-inline-style' hidden><style>{$styles}</style></div>" : '';
+    }
+
     /**
      * Extract value attribute from attribute list
      *
@@ -79,15 +87,15 @@
     protected function extractValueFromAttributes(&$element)
     {
         $value = '';
-
+
         if (isset($element['attributes']['value'])) {
             $value = $element['attributes']['value'];
             unset($element['attributes']['value']);
         }
-
+
         return $value;
     }
-
+
     protected function extractDynamicValues($data, $form)
     {
         $defaultValues = [];
@@ -102,7 +110,7 @@
         }
         return $defaultValues;
     }
-
+
     /**
      * Determine if the given element has conditions bound
      *
@@ -113,28 +121,28 @@
     protected function hasConditions($element)
     {
         $conditionals = ArrayHelper::get($element, 'settings.conditional_logics');
-
+
         if (isset($conditionals['status']) && $conditionals['status']) {
-            if (isset($conditionals['type']) && $conditionals['type'] === 'group') {
+            if (isset($conditionals['type']) && 'group' === $conditionals['type']) {
                 $groups = ArrayHelper::get($conditionals, 'condition_groups');
                 if (!is_array($groups)) {
                     return false;
                 }
-
+
                 $groups = array_filter($groups, function ($group) {
                     $rules = ArrayHelper::get($group, 'rules', []);
                     return !empty(array_filter($rules, fn($rule) => !empty($rule['field']) && !empty($rule['operator'])));
                 });
-                return !!$groups;
+                return (bool) $groups;
             }

-            return !!array_filter($conditionals['conditions'], function ($item) {
+            return (bool) array_filter($conditionals['conditions'], function ($item) {
                 return $item['field'] && $item['operator'];
             });
         }
         return false;
     }
-
+
     /**
      * Generate a unique id for an element
      *
@@ -146,16 +154,17 @@
     {
         return $str . '_' . md5(uniqid(wp_rand(), true));
     }
-
+
     /**
      * Get a default class for each form element wrapper
+     *
      * @return string
      */
     protected function getDefaultContainerClass()
     {
         return 'ff-el-group ';
     }
-
+
     /**
      * Get required class for form element wrapper
      *
@@ -169,23 +178,24 @@
             return $rules['required']['value'] ? 'ff-el-is-required ' : '';
         }
     }
-
+
     /**
      * Get asterisk placement for the required form elements
+     *
      * @return string
      */
     protected function getAsteriskPlacement($form)
     {
         // for older version compatibility
         $asteriskPlacement = 'asterisk-right';
-
+
         if (isset($form->settings['layout']['asteriskPlacement'])) {
             $asteriskPlacement = $form->settings['layout']['asteriskPlacement'];
         }
-
+
         return $asteriskPlacement . ' ';
     }
-
+
     /**
      * Generate a label for any element
      *
@@ -200,15 +210,15 @@
         if ('with_label' == $helpMessagePlacement) {
             $helpMessage = $this->getLabelHelpMessage($data);
         }
-
+
         $id = isset($data['attributes']['id']) ? $data['attributes']['id'] : '';
         $label = isset($data['settings']['label']) ? $data['settings']['label'] : '';
         $requiredClass = $this->getRequiredClass(ArrayHelper::get($data, 'settings.validation_rules', []));
         $classes = trim('ff-el-input--label ' . $requiredClass . $this->getAsteriskPlacement($form));
-
+
         return "<div class='" . esc_attr($classes) . "'><label aria-label='" . esc_attr($this->removeShortcode($label)) . "' for='" . esc_attr($id) . "'>" . fluentform_sanitize_html($label) . '</label>' . $helpMessage . '</div>';
     }
-
+
     /**
      * Generate html/markup for any element
      *
@@ -221,28 +231,28 @@
     protected function buildElementMarkup($elMarkup, $data, $form)
     {
         $hasConditions = $this->hasConditions($data) ? 'has-conditions ' : '';
-
+
         $labelPlacement = ArrayHelper::get($data, 'settings.label_placement');
-
+
         $labelPlacementClass = $labelPlacement ? 'ff-el-form-' . $labelPlacement . ' ' : '';
-
+
         $validationRules = ArrayHelper::get($data, 'settings.validation_rules');
-
+
         $requiredClass = $this->getRequiredClass($validationRules);
-
+
         $labelClass = trim(
             'ff-el-input--label ' .
             $requiredClass .
             $this->getAsteriskPlacement($form)
         );
-
+
         $formGroupClass = trim(
             $this->getDefaultContainerClass() .
             $labelPlacementClass .
             $hasConditions .
             ArrayHelper::get($data, 'settings.container_class')
         );
-
+
         $labelHelpText = $inputHelpText = '';

         $labelPlacement = ArrayHelper::get($form->settings, 'layout.helpMessagePlacement', 'with_label');
@@ -255,50 +265,35 @@
         } else {
             $inputHelpText = $this->getInputHelpMessage($data);
         }
-
+
         $forStr = '';
         $LabelId = '';
         if (isset($data['attributes']['id'])) {
             $forStr = "for='" . esc_attr($data['attributes']['id']) . "'";
             $LabelId = "id='" . esc_attr('label_' . $data['attributes']['id']) . "'";
         }
-
+
         $labelMarkup = '';
-
+
         if (!empty($data['settings']['label'])) {
             $label = ArrayHelper::get($data, 'settings.label');
-            $ariaLabel = $label;
-
-            $hasShortCodeIndex = strpos($label, '{dynamic.');
-
-            //Handle name field duplicate label accessibility
-            $isNameField = strpos(ArrayHelper::get($data, 'attributes.name', ''), 'name') !== false;
-            if ($isNameField) {
-                $ariaLabel = '';
-            } elseif ($hasShortCodeIndex !== false) {
-                $ariaLabel = trim(substr($label, 0, $hasShortCodeIndex));
-            } else {
-                $ariaLabel = $label;
-            }
-
             $labelMarkup = sprintf(
-                '<div class="%1$s"><label %2$s %3$s %4$s>%5$s</label>%6$s</div>',
+                '<div class="%1$s"><label %2$s %3$s>%4$s</label>%5$s</div>',
                 esc_attr($labelClass),
                 $forStr,
                 $LabelId,
-                $ariaLabel != '' ? 'aria-label="' . esc_attr($this->removeShortcode($label)) . '"' : '',
                 fluentform_sanitize_html($label),
                 fluentform_sanitize_html($labelHelpText)
             );
         }
-
+
         $inputHelpText = fluentform_sanitize_html($inputHelpText);
-
+
         if ('after_label' == $labelPlacement) {
             $elMarkup = $inputHelpText . $elMarkup;
             $inputHelpText = '';
         }
-
+
         return sprintf(
             "<div class='%s'>%s<div class='ff-el-input--content'>%s%s</div></div>",
             esc_attr($formGroupClass),
@@ -307,7 +302,7 @@
             $inputHelpText
         );
     }
-
+
     /**
      * Generate a help message for any element beside label
      *
@@ -323,7 +318,7 @@
             return sprintf('<div class="ff-el-tooltip" data-content="%s">%s</div>', $text, $icon);
         }
     }
-
+
     /**
      * Generate a help message for any element beside form element
      *
@@ -334,23 +329,23 @@
     protected function getInputHelpMessage($data, $hideClass = '')
     {
         $class = trim('ff-el-help-message ' . $hideClass);
-
+
         if (isset($data['settings']['help_message']) && !empty($data['settings']['help_message'])) {
             return "<div class='" . esc_attr($class) . "'>" . fluentform_sanitize_html($data['settings']['help_message']) . '</div>';
         }
         return false;
     }
-
+
     protected function parseEditorSmartCode($text, $form)
     {
         return (new Component($this->app))->replaceEditorSmartCodes($text, $form);
     }
-
+
     protected function printContent($hook, $html, $data, $form)
     {
         echo apply_filters($hook, $html, $data, $form); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound,WordPress.Security.EscapeOutput.OutputNotEscaped -- Dynamic hook name for component content filter. $html is escaped before being passed in.
     }
-
+
     /**
      * A helper method for remove shortcode from aria label
      *
@@ -362,7 +357,7 @@
     {
         // Find all occurrences of text enclosed in curly braces.
         preg_match_all('/{(.*?)}/', $label, $matches);
-
+
         // If there are matches, remove them from the label.
         if ($matches[0]) {
             $label = trim(str_replace($matches[0], '', $label));
--- a/fluentform/app/Services/FormBuilder/Components/CustomSubmitButton.php
+++ b/fluentform/app/Services/FormBuilder/Components/CustomSubmitButton.php
@@ -108,7 +108,7 @@
         $hideSubmit = apply_filters_deprecated(
             'fluentform_is_hide_submit_btn_' . $form->id,
             [
-                '__return_true'
+                '__return_true',
             ],
             FLUENTFORM_FRAMEWORK_UPGRADE,
             'fluentform/is_hide_submit_btn_' . $form->id,
@@ -118,12 +118,12 @@
         add_filter('fluentform/is_hide_submit_btn_' . $form->id, $hideSubmit);

         $elementName = $data['element'];
-
+
         $data = apply_filters_deprecated(
             'fluentform_rendering_field_data_' . $elementName,
             [
                 $data,
-                $form
+                $form,
             ],
             FLUENTFORM_FRAMEWORK_UPGRADE,
             'fluentform/rendering_field_data_' . $elementName,
@@ -215,11 +215,7 @@
             $html .= '<button ' . $atts . ' aria-label="' . esc_attr($this->removeShortcode($buttonText)) . '">' . fluentform_sanitize_html($buttonText) . '</button>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- $atts is escaped before being passed in.
         }

-        // SECURITY (FINDING-12): neutralize any </style> breakout in the user-built custom-button CSS.
-        $styles = fluentformSanitizeCSS($styles);
-        if ($styles) {
-            $html .= '<style>' . $styles . '</style>';
-        }
+        $html = $this->buildInlineStyleContainer($styles) . $html;

         $html .= '</div>';

@@ -228,7 +224,7 @@
             [
                 $html,
                 $data,
-                $form
+                $form,
             ],
             FLUENTFORM_FRAMEWORK_UPGRADE,
             'fluentform/rendering_field_html_' . $elementName,
--- a/fluentform/app/Services/FormBuilder/Components/SubmitButton.php
+++ b/fluentform/app/Services/FormBuilder/Components/SubmitButton.php
@@ -2,7 +2,7 @@

 namespace FluentFormAppServicesFormBuilderComponents;

-defined('ABSPATH') or die;
+defined('ABSPATH') || die;

 use FluentFormAppHelpersHelper;
 use FluentFormFrameworkHelpersArrayHelper;
@@ -22,23 +22,23 @@
         $maybeHide = apply_filters_deprecated(
             'fluentform_is_hide_submit_btn_' . $form->id,
             [
-                false
+                false,
             ],
             FLUENTFORM_FRAMEWORK_UPGRADE,
             'fluentform/is_hide_submit_btn_' . $form->id,
-            'Use fluentform/is_hide_submit_btn_' . $form->id. ' instead of fluentform_is_hide_submit_btn_' . $form->id
+            'Use fluentform/is_hide_submit_btn_' . $form->id . ' instead of fluentform_is_hide_submit_btn_' . $form->id
         );
         if (apply_filters('fluentform/is_hide_submit_btn_' . $form->id, $maybeHide)) {
             return '';
         }

         $elementName = $data['element'];
-
+
         $data = apply_filters_deprecated(
             'fluentform_rendering_field_data_' . $elementName,
             [
                 $data,
-                $form
+                $form,
             ],
             FLUENTFORM_FRAMEWORK_UPGRADE,
             'fluentform/rendering_field_data_' . $elementName,
@@ -48,14 +48,14 @@
         $data = apply_filters('fluentform/rendering_field_data_' . $elementName, $data, $form);

         $btnStyle = ArrayHelper::get($data['settings'], 'button_style');
-
+
         /* This filter is deprecated and will be removed soon */
         $noStyle = apply_filters('fluentform_submit_button_force_no_style', false);
-
+
         if (apply_filters('fluentform/submit_button_force_no_style', $noStyle)) {
             $btnStyle = 'no_style';
         }
-
+
         $btnSize = 'ff-btn-';
         $btnSize .= isset($data['settings']['button_size']) ? $data['settings']['button_size'] : 'md';
         $oldBtnType = isset($data['settings']['button_style']) ? '' : ' ff-btn-primary ';
@@ -66,9 +66,9 @@
             $btnSize,
             $data['attributes']['class'],
         ];
-
-        $loadDefaultFluentStyle = $form->theme != 'ffs_inherit_theme';
-        if(!$loadDefaultFluentStyle){
+
+        $loadDefaultFluentStyle = 'ffs_inherit_theme' != $form->theme;
+        if (!$loadDefaultFluentStyle) {
             $btnStyle = 'no_style';
         }
         if ('no_style' == $btnStyle) {
@@ -119,7 +119,7 @@
             }
         } elseif ('no_style' != $btnStyle) {
             $bgColor = esc_attr(ArrayHelper::get($data, 'settings.background_color'));
-            $bgColor = str_replace('#1a7efb','var(--fluentform-primary)',$bgColor);
+            $bgColor = str_replace('#1a7efb', 'var(--fluentform-primary)', $bgColor);
             $styles .= 'form.fluent_form_' . $form->id . ' .ff-btn-submit:not(.ff_btn_no_style) { background-color: ' . $bgColor . '; color: ' . esc_attr(ArrayHelper::get($data, 'settings.color')) . '; }';
         }

@@ -141,28 +141,15 @@
             $html .= '<button ' . $atts . ' aria-label="' . esc_attr($this->removeShortcode($buttonText)) . '">' . fluentform_sanitize_html($buttonText) . '</button>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- $atts is escaped before being passed in.
         }

-        // SECURITY (FINDING-12): the custom-button style map keys and values are user-controlled
-        // and unsanitized at save; a value like "#fff}</style><script>..." would break out of the
-        // <style> element. fluentformSanitizeCSS() blanks any CSS containing a tag pattern.
-        $styles = fluentformSanitizeCSS($styles);
-        if ($styles) {
-            if (did_action('wp_footer') || Helper::isBlockEditor()) {
-                $html .= '<style>' . $styles . '</style>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- $styles is sanitized via fluentformSanitizeCSS().
-            } else {
-                add_action('wp_footer', function () use ($styles) {
-                    echo '<style>' . $styles . '</style>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- $styles is sanitized via fluentformSanitizeCSS().
-                });
-            }
-        }
-
         $html .= '</div>';
-
+        $html = $this->buildInlineStyleContainer($styles) . $html;
+
         $html = apply_filters_deprecated(
             'fluentform_rendering_field_html_' . $elementName,
             [
                 $html,
                 $data,
-                $form
+                $form,
             ],
             FLUENTFORM_FRAMEWORK_UPGRADE,
             'fluentform/rendering_field_html_' . $elementName,
--- a/fluentform/app/Services/FormBuilder/Components/TermsAndConditions.php
+++ b/fluentform/app/Services/FormBuilder/Components/TermsAndConditions.php
@@ -22,7 +22,7 @@
             'fluentform_rendering_field_data_' . $elementName,
             [
                 $data,
-                $form
+                $form,
             ],
             FLUENTFORM_FRAMEWORK_UPGRADE,
             'fluentform/rendering_field_data_' . $elementName,
@@ -63,9 +63,9 @@
         if ($data['settings']['has_checkbox']) {
             $checkbox = "<span class='ff_tc_checkbox'><input {$atts} value='on' aria-invalid='false' aria-required={$ariaRequired}></span>"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- $atts is escaped before being passed in.
         }
-
+
         $link_count = substr_count($data['settings']['tnc_html'], '<a ');
-        if($link_count > 0){
+        if ($link_count > 0) {
             $ariaLabel = sprintf(
                 /* translators: 1: Terms title or HTML label, 2: Number of links in the terms text. */
                 esc_html(_n(
@@ -77,11 +77,10 @@
                 $data['settings']['tnc_html'],
                 $link_count
             );
-        }else{
+        } else {
             $ariaLabel = wp_strip_all_tags($data['settings']['tnc_html']);
         }
-
-
+
         $ariaLabel = wp_strip_all_tags($ariaLabel);
         $ariaLabel = esc_attr($ariaLabel);
         $html = "<div class='" . esc_attr($cls) . "'>";
@@ -91,13 +90,13 @@
         $html .= '</label>';
         $html .= '</div>';
         $html .= '</div>';
-
+
         $html = apply_filters_deprecated(
             'fluentform_rendering_field_html_' . $elementName,
             [
                 $html,
                 $data,

Frequently Asked Questions

Atomic Edge WAF security layer inspecting website traffic.

How Atomic Edge Works

Simple Setup. Powerful Security.

Atomic Edge acts as a security layer between your website & the internet. Our AI inspection and analysis engine auto blocks threats before traditional firewall services can inspect, research and build archaic regex filters.

Get Started

Trusted by Developers & Organizations

Trusted by Developers
Black & McDonald logo representing Enterprise tier security and support for Atomic Edge WAF.Covenant House Toronto logo featuring a dove and text for Atomic Edge Enterprise planAlzheimer Society Canada logo representing trusted organizations and security partners.University of Toronto logo representing trusted organizations using Atomic Edge WAFSpecsavvers logo, trusted developers and organizations using Atomic Edge securityHarvard Medical School logo representing trusted organizations using Atomic Edge WAF.