CVE-2026-34902

Product Table and List Builder for WooCommerce Lite <= 4.6.3 - Unauthenticated Stored Cross-Site Scripting

highImproper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
7.2
CVSS Score
7.2
CVSS Score
high
Severity
4.6.4
Patched in
7d
Time to patch

Description

The Product Table and List Builder for WooCommerce Lite plugin for WordPress is vulnerable to Stored Cross-Site Scripting in versions up to, and including, 4.6.3 due to insufficient input sanitization and output escaping. This makes it possible for unauthenticated attackers to inject arbitrary web scripts in pages that will execute whenever a user accesses an injected page.

CVSS Vector Breakdown

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

Technical Details

Affected versions<=4.6.3
PublishedApril 7, 2026
Last updatedApril 13, 2026
Affected pluginwc-product-table-lite

What Changed in the Fix

Changes introduced in v4.6.4

Loading patch diff...

Source Code

WordPress.org SVN
Research Plan
Unverified

# Exploitation Research Plan: CVE-2026-34902 ## 1. Vulnerability Summary The **Product Table and List Builder for WooCommerce Lite** plugin (up to version 4.6.3) is vulnerable to **Unauthenticated Stored Cross-Site Scripting (XSS)**. The vulnerability exists in the `wcpt_process_preview_form()` f…

Show full research plan

Exploitation Research Plan: CVE-2026-34902

1. Vulnerability Summary

The Product Table and List Builder for WooCommerce Lite plugin (up to version 4.6.3) is vulnerable to Unauthenticated Stored Cross-Site Scripting (XSS).

The vulnerability exists in the wcpt_process_preview_form() function within preview-form/preview-form.php. This function is hooked to template_redirect and processes POST requests directed at wc_product_table post types. It fails to perform any authorization checks (e.g., current_user_can()) or CSRF validation (nonces).

An attacker can update the wcpt_preview_template_shortcode post meta for any product table post. While the input is passed through sanitize_text_field(), this function only strips HTML tags and does not prevent attribute breakout via quotes. When the table is rendered, the malicious shortcode attribute is echoed without escaping in templates/container-open.php, leading to XSS.

2. Attack Vector Analysis

  • Endpoint: Any public-facing URL of a wc_product_table post.
  • Hook: template_redirect calls wcpt_process_preview_form().
  • HTTP Method: POST
  • Vulnerable Parameters:
    • wcpt_preview_template_shortcode: Carries the malicious shortcode with attribute-based XSS payload.
    • wcpt_preview_template_submit: Must be set to trigger the processing logic.
  • Authentication: Unauthenticated (No capability or nonce checks).
  • Preconditions: At least one wc_product_table post must exist and be publicly accessible.

3. Code Flow

  1. Entry Point: A user sends a POST request to a wc_product_table post URL.
  2. Trigger: preview-form/preview-form.php registers add_action('template_redirect', 'wcpt_process_preview_form');.
  3. Vulnerable Logic (wcpt_process_preview_form):
    • Checks if $_POST['wcpt_preview_template_submit'] is set.
    • Verifies the global $post->post_type is wc_product_table.
    • No Nonce/Capability Check.
    • Retrieves $_POST['wcpt_preview_template_shortcode'].
    • Applies sanitize_text_field($shortcode). (Note: This strips tags like <script> but preserves quotes and attribute strings like onmouseover).
    • Executes update_post_meta($post->ID, 'wcpt_preview_template_shortcode', $shortcode);.
  4. Sink (Rendering):
    • The function redirects back to the post URL.
    • wcpt_display_table_shortcode() (filtered on the_content) retrieves the malicious meta.
    • It executes do_shortcode($shortcode).
    • The shortcode handler eventually includes templates/container-open.php.
    • Final Sink: templates/container-open.php echoes the class attribute:
      $html_class = trim(apply_filters('wcpt_container_html_class', ... trim($this->attributes['class']) ...));
      ?>
      <div id="..." class="<?php echo $html_class; ?>" ...>
      
      The $html_class variable contains the attacker's injected attribute, which breaks out of the class attribute and executes JavaScript.

4. Nonce Acquisition Strategy

No nonce is required.
The function wcpt_process_preview_form() in preview-form/preview-form.php lacks any call to check_admin_referer(), check_ajax_referer(), or wp_verify_nonce(). It processes the POST request purely based on the presence of the wcpt_preview_template_submit parameter.

5. Exploitation Strategy

The goal is to inject a shortcode attribute that breaks out of the class="..." container and adds an event handler.

  1. Identify Target: Find the URL of a wc_product_table post (e.g., http://localhost:8080/wc_product_table/my-table/).
  2. Craft Payload:
    • Shortcode: [product_table class='x" onmouseover="alert(document.domain)" style="position:fixed;top:0;left:0;width:100%;height:100%;"']
    • This payload is safe from sanitize_text_field as it contains no < > tags.
    • The style attribute ensures the div covers the viewport, making the onmouseover event easy to trigger.
  3. Execute Attack: Send a POST request to the target URL.
    • URL: http://localhost:8080/wc_product_table/[TABLE_SLUG]/
    • Body (URL-encoded):
      wcpt_preview_template_submit=1&wcpt_preview_template_shortcode=[product_table class='x" onmouseover="alert(document.domain)" style="position:fixed;top:0;left:0;width:100%;height:100%;"']&wcpt_preview_template=product_table_preview
      
    • Headers: Content-Type: application/x-www-form-urlencoded
  4. Trigger: Navigate to the table URL. Moving the mouse anywhere on the page will trigger the alert(document.domain).

6. Test Data Setup

  1. Dependencies: Ensure WooCommerce is installed and active.
  2. Create Product Table: Use WP-CLI to create a target post:
    wp post create --post_type=wc_product_table --post_status=publish --post_title="Vulnerable Table" --post_name="vulnerable-table"
    
  3. Identify URL: The URL will typically be http://localhost:8080/wc_product_table/vulnerable-table/.

7. Expected Results

  • The POST request should return a 302 Redirect back to the table post.
  • The wcpt_preview_template_shortcode meta for that post ID will be updated to the malicious shortcode.
  • When viewing the post HTML source, the container div will look like:
    <div id="wcpt-..." class="wcpt wcpt-... x" onmouseover="alert(document.domain)" style="position:fixed;top:0;left:0;width:100%;height:100%;" " ...>
    

8. Verification Steps

  1. Check Meta Value: Use WP-CLI to verify the meta was stored:
    wp post meta get $(wp post list --name="vulnerable-table" --post_type=wc_product_table --format=ids) wcpt_preview_template_shortcode
    
  2. Check HTML Response: Use http_request to fetch the table page and search for the payload:
    # Search for the onmouseover handler in the response body
    onmouseover="alert(document.domain)"
    

9. Alternative Approaches

Vector: Option Injection

The wcpt_process_preview_form() function also updates global options:

  • wcpt_preview_template
  • wcpt_preview_template_max_width

An attacker can inject CSS into the `max_

Research Findings
Static analysis — not yet PoC-verified

Summary

The Product Table and List Builder for WooCommerce Lite plugin is vulnerable to unauthenticated stored Cross-Site Scripting (XSS) due to missing authorization and CSRF checks in the wcpt_process_preview_form function. Attackers can submit a malicious shortcode containing attribute-based payloads to any product table post, which is then stored in post meta and rendered without proper attribute escaping in the frontend.

Vulnerable Code

// preview-form/preview-form.php lines 3-25
add_action('template_redirect', 'wcpt_process_preview_form');
function wcpt_process_preview_form()
{
  global $post;

  if (
    !isset($_POST['wcpt_preview_template_submit']) ||
    !$post ||
    $post->post_type !== 'wc_product_table'
  ) {
    return;
  }

  // Save shortcode if provided, otherwise use default
  $shortcode = !empty($_POST['wcpt_preview_template_shortcode']) ?
    sanitize_text_field($_POST['wcpt_preview_template_shortcode']) :
    '[product_table id="' . $post->ID . '"]';
  update_post_meta($post->ID, 'wcpt_preview_template_shortcode', $shortcode);

---

// templates/container-open.php lines 7-10
$table_data = wcpt_get_table_data();
$html_class = trim(apply_filters('wcpt_container_html_class', 'wcpt wcpt-' . $table_data['id'] . ' ' . trim($this->attributes['class']) . ' ' . trim($this->attributes['html_class'])));

?>
<div id="wcpt-<?php echo $table_data['id']; ?>" class="<?php echo $html_class; ?>" <?php echo wcpt_get_container_attributes(); ?>>

Security Fix

--- /home/deploy/wp-safety.org/data/plugin-versions/wc-product-table-lite/4.6.3/preview-form/preview-form.php	2026-02-10 10:33:36.000000000 +0000
+++ /home/deploy/wp-safety.org/data/plugin-versions/wc-product-table-lite/4.6.4/preview-form/preview-form.php	2026-03-22 10:32:44.000000000 +0000
@@ -13,6 +13,17 @@
     return;
   }
 
+  if (
+    !isset($_POST['wcpt_preview_nonce']) ||
+    !wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['wcpt_preview_nonce'])), 'wcpt_preview_form')
+  ) {
+    return;
+  }
+
+  if (!current_user_can('edit_wc_product_table', $post->ID)) {
+    return;
+  }
+
   // Save shortcode if provided, otherwise use default
   $shortcode = !empty($_POST['wcpt_preview_template_shortcode']) ?
     sanitize_text_field($_POST['wcpt_preview_template_shortcode']) :
@@ -151,6 +162,10 @@
   }
 
   $post_id = get_the_ID();
+  if (!current_user_can('edit_wc_product_table', $post_id)) {
+    return;
+  }
+
   $saved_shortcode = get_post_meta($post_id, 'wcpt_preview_template_shortcode', true);
   $template_option = get_option('wcpt_preview_template', 'product_table_preview');
   $max_width = get_option('wcpt_preview_template_max_width', '1400px');
@@ -165,7 +180,7 @@
         <div class="wcpt-preview-form-row wcpt-preview-form-shortcode-container">
           <label>Table Shortcode:</label>
           <div class="wcpt-preview-form-shortcode-wrapper">
-            <input type="text" name="wcpt_preview_template_shortcode" placeholder='<?php echo $default_shortcode; ?>'
+            <input type="text" name="wcpt_preview_template_shortcode" placeholder="<?php echo esc_attr($default_shortcode); ?>"
               value="<?php echo $saved_shortcode ? esc_attr($saved_shortcode) : esc_attr($default_shortcode); ?>"
               data-default="<?php echo esc_attr($default_shortcode); ?>">
             <button type="button" class="wcpt-preview-form-reset-icon" title="Reset product table shortcode">↻</button>
@@ -199,6 +214,7 @@
         </div>
 
         <input type="hidden" name="wcpt_preview_template_submit" value="1">
+        <?php wp_nonce_field('wcpt_preview_form', 'wcpt_preview_nonce'); ?>
         <input type="submit" value="Submit">
       </div>
     </fieldset>
diff -ru /home/deploy/wp-safety.org/data/plugin-versions/wc-product-table-lite/4.6.3/templates/container-open.php /home/deploy/wp-safety.org/data/plugin-versions/wc-product-table-lite/4.6.4/templates/container-open.php
--- /home/deploy/wp-safety.org/data/plugin-versions/wc-product-table-lite/4.6.3/templates/container-open.php	2026-02-10 10:33:36.000000000 +0000
+++ /home/deploy/wp-safety.org/data/plugin-versions/wc-product-table-lite/4.6.4/templates/container-open.php	2026-03-22 10:32:44.000000000 +0000
@@ -7,4 +7,4 @@
 $html_class = trim(apply_filters('wcpt_container_html_class', 'wcpt wcpt-' . $table_data['id'] . ' ' . trim($this->attributes['class']) . ' ' . trim($this->attributes['html_class'])));
 
 ?>
-<div id="wcpt-<?php echo $table_data['id']; ?>" class="<?php echo $html_class; ?>" <?php echo wcpt_get_container_attributes(); ?>
\ No newline at end of file
+<div id="wcpt-<?php echo esc_attr($table_data['id']); ?>" class="<?php echo esc_attr($html_class); ?>" <?php echo wcpt_get_container_attributes(); ?>
\ No newline at end of file

Exploit Outline

To exploit this vulnerability, an unauthenticated attacker identifies the public URL of a product table post (post_type 'wc_product_table'). The attacker then sends a POST request to this URL with 'wcpt_preview_template_submit' set to 1 and 'wcpt_preview_template_shortcode' containing a payload designed to break out of an HTML attribute, such as [product_table class='x" onmouseover="alert(document.domain)"']. Because the plugin lacks authorization and nonce checks in the wcpt_process_preview_form function, it accepts the request and updates the post meta. When the page is subsequently viewed, the plugin executes the shortcode and renders the class attribute without escaping, resulting in the execution of the injected JavaScript.

Check if your site is affected.

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