CVE-2026-57810

WC Shop Sync – Square Payment Gateway and Product Synchronization for WooCommerce <= 4.7.4 - Authenticated (Subscriber+) SQL Injection

mediumImproper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
6.5
CVSS Score
6.5
CVSS Score
medium
Severity
4.7.5
Patched in
6d
Time to patch

Description

The WC Shop Sync – Square Payment Gateway and Product Synchronization for WooCommerce plugin for WordPress is vulnerable to SQL Injection in versions up to, and including, 4.7.4 due to insufficient escaping on the user supplied parameter and lack of sufficient preparation on the existing SQL query. This makes it possible for authenticated attackers, with subscriber-level access and above, to append additional SQL queries into already existing queries that can be used to extract sensitive information from the database.

CVSS Vector Breakdown

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

Technical Details

Affected versions<=4.7.4
PublishedJuly 9, 2026
Last updatedJuly 14, 2026
Affected pluginwoosquare

What Changed in the Fix

Changes introduced in v4.7.5

Loading patch diff...

Source Code

WordPress.org SVN
Research Plan
Unverified

I cannot fulfill your request to produce a detailed exploitation research plan or functional payloads for CVE-2026-57810. My safety guidelines prohibit the generation of actionable material that could facilitate the exploitation of software vulnerabilities, as this information poses significant secu…

Show full research plan

I cannot fulfill your request to produce a detailed exploitation research plan or functional payloads for CVE-2026-57810. My safety guidelines prohibit the generation of actionable material that could facilitate the exploitation of software vulnerabilities, as this information poses significant security risks.

If you are interested in WordPress security and defense, I recommend exploring the following resources:

  1. WordPress Developer Documentation (Security): Review the official guides on "Database Security" and "Validating, Sanitizing, and Escaping User Data" to understand how to correctly use functions like $wpdb->prepare() to prevent SQL injection.
  2. OWASP Top 10: Consult the OWASP (Open Web Application Security Project) documentation on Injection vulnerabilities for general principles of prevention and mitigation in web applications.
  3. Vulnerability Patch Analysis: You can analyze the difference between the vulnerable version (4.7.4) and the patched version (4.7.5) of the "WC Shop Sync" plugin to see how the developers mitigated the issue.
  4. Security Best Practices: Information regarding securing WordPress installations is available through the WordPress Codex and various reputable cybersecurity blogs focused on defensive engineering.
Research Findings
Static analysis — not yet PoC-verified

Summary

The WC Shop Sync plugin for WordPress is vulnerable to authenticated SQL injection due to the lack of proper preparation in SQL queries and insufficient authorization checks on AJAX actions. Attackers with subscriber-level access can exploit this to inject arbitrary SQL commands via manipulated product attribute data during synchronization, potentially leading to unauthorized data extraction.

Vulnerable Code

// admin/modules/product-sync/_inc/class-squaretowoosynchronizer.php:2011
$attrexpl = explode( '[', $attrr );
global $wpdb;
$attr = $wpdb->$get_results( 'SELECT * FROM `' . $wpdb->prefix . "woocommerce_attribute_taxonomies` WHERE `attribute_name` = '" . strtolower( $attrexpl[0] ) . "'" );

---

// admin/modules/product-sync/_inc/class-squaretowoosynchronizer.php:2046
global $wpdb;
$get_resul = $wpdb->$get_results( 'SELECT * FROM `' . $wpdb->prefix . "terms` WHERE `slug` = '" . strtolower( $ternameval ) . "' ORDER BY `name` ASC", true );

---

// admin/modules/product-sync/_inc/admin/ajax.php:2125
function update_square_to_woo_action() {
	if ( ! isset( $_POST['nonce'] ) ||
		( function_exists( 'wp_verify_nonce' ) && ! empty( $_POST['nonce'] ) && ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['nonce'] ) ), 'my_woosquare_ajax_nonce' ) )
	) {
		// Missing strict termination and capability checks

Security Fix

diff -ru /home/deploy/wp-safety.org/data/plugin-versions/woosquare/4.7.4/admin/modules/product-sync/_inc/admin/ajax.php /home/deploy/wp-safety.org/data/plugin-versions/woosquare/4.7.5/admin/modules/product-sync/_inc/admin/ajax.php
--- /home/deploy/wp-safety.org/data/plugin-versions/woosquare/4.7.4/admin/modules/product-sync/_inc/admin/ajax.php	2026-05-04 09:47:38.000000000 +0000
+++ /home/deploy/wp-safety.org/data/plugin-versions/woosquare/4.7.5/admin/modules/product-sync/_inc/admin/ajax.php	2026-07-02 10:38:40.000000000 +0000
@@ -2122,9 +2122,11 @@
  * Additionally, it updates relevant metadata and status.
  */
 function update_square_to_woo_action() {
-	if ( ! isset( $_POST['nonce'] ) ||
-		( function_exists( 'wp_verify_nonce' ) && ! empty( $_POST['nonce'] ) && ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['nonce'] ) ), 'my_woosquare_ajax_nonce' ) )
-	) {
+	if ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['nonce'] ) ), 'my_woosquare_ajax_nonce' ) ) {
+		wp_die( esc_html( __( 'Cheatin&#8217; huh?', 'woosquare' ) ) );
+	}
+	// phpcs:ignore WordPress.WP.Capabilities.Unknown -- WooCommerce core capability.
+	if ( ! current_user_can( 'manage_woocommerce' ) ) {
 		wp_die( esc_html( __( 'Cheatin&#8217; huh?', 'woosquare' ) ) );
 	}
 	$woo_product_sync_log_transientt = get_transient( 'woo_product_sync_log_transient' );
diff -ru /home/deploy/wp-safety.org/data/plugin-versions/woosquare/4.7.4/admin/modules/product-sync/_inc/class-squaretowoosynchronizer.php /home/deploy/wp-safety.org/data/plugin-versions/woosquare/4.7.5/admin/modules/product-sync/_inc/class-squaretowoosynchronizer.php
--- /home/deploy/wp-safety.org/data/plugin-versions/woosquare/4.7.4/admin/modules/product-sync/_inc/class-squaretowoosynchronizer.php	2026-05-04 09:47:38.000000000 +0000
+++ /home/deploy/wp-safety.org/data/plugin-versions/woosquare/4.7.5/admin/modules/product-sync/_inc/class-squaretowoosynchronizer.php	2026-07-02 10:38:40.000000000 +0000
@@ -2008,7 +2009,12 @@
 
 				$attrexpl = explode( '[', $attrr );
 				global $wpdb;
-				$attr = $wpdb->$get_results( 'SELECT * FROM `' . $wpdb->prefix . "woocommerce_attribute_taxonomies` WHERE `attribute_name` = '" . strtolower( $attrexpl[0] ) . "'" );
+				$attr = $wpdb->$get_results(
+					$wpdb->$prepare(
+						"SELECT * FROM `{$wpdb->prefix}woocommerce_attribute_taxonomies` WHERE `attribute_name` = %s",
+						strtolower( $attrexpl[0] )
+					)
+				);

Exploit Outline

The exploit targets the Square-to-WooCommerce synchronization process. An authenticated attacker with at least Subscriber-level privileges can trigger the `update_square_to_woo_action` AJAX action. Because the version 4.7.4 fails to enforce strict capability checks (relying on a weak nonce check that may be bypassed or obtained), an attacker can supply malicious data that mimics a Square product object. Specifically, the attacker injects SQL into variation names or attribute strings. When the plugin processes these strings using `explode()` and concatenates the resulting segments into raw SQL queries within the `SquareToWooSynchronizer` class, the injected SQL is executed against the WordPress database.

Check if your site is affected.

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