[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"$fEdsuYMJT1ybwqTlO9wySgHXBmTC1R_AjWYtEwIqxvt8":3},{"id":4,"url_slug":5,"title":6,"description":7,"plugin_slug":8,"theme_slug":9,"affected_versions":10,"patched_in_version":11,"severity":12,"cvss_score":13,"cvss_vector":14,"vuln_type":15,"published_date":16,"updated_date":17,"references":18,"days_to_patch":20,"patch_diff_files":21,"patch_trac_url":9,"research_status":29,"research_verified":30,"research_rounds_completed":31,"research_plan":32,"research_summary":33,"research_vulnerable_code":34,"research_fix_diff":35,"research_exploit_outline":36,"research_model_used":37,"research_started_at":38,"research_completed_at":39,"research_error":9,"poc_status":9,"poc_video_id":9,"poc_summary":9,"poc_steps":9,"poc_tested_at":9,"poc_wp_version":9,"poc_php_version":9,"poc_playwright_script":9,"poc_exploit_code":9,"poc_has_trace":30,"poc_model_used":9,"poc_verification_depth":9,"poc_exploit_code_gated":30,"source_links":40},"CVE-2026-7517","custom-payment-gateways-for-woocommerce-unauthenticated-stored-cross-site-scripting-via-algwccpginputfields-parameter","Custom Payment Gateways for WooCommerce \u003C= 2.1.0 - Unauthenticated Stored Cross-Site Scripting via 'alg_wc_cpg_input_fields' Parameter","The Custom Payment Gateways for WooCommerce plugin for WordPress is vulnerable to Stored Cross-Site Scripting via the 'alg_wc_cpg_input_fields' parameter in all versions up to, and including, 2.1.0 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. This vulnerability is exploitable by unauthenticated guest users submitting a crafted checkout POST request, requiring no custom input fields to be configured in the plugin.","custom-payment-gateways-woocommerce",null,"\u003C=2.1.0","2.2.0","high",7.2,"CVSS:3.1\u002FAV:N\u002FAC:L\u002FPR:N\u002FUI:N\u002FS:C\u002FC:L\u002FI:L\u002FA:N","Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')","2026-06-30 15:45:01","2026-07-01 04:32:26",[19],"https:\u002F\u002Fwww.wordfence.com\u002Fthreat-intel\u002Fvulnerabilities\u002Fid\u002F1defa728-9f9d-4e8f-8f6c-432c615da7f5?source=api-prod",1,[22,23,24,25,26,27,28],"custom-payment-gateways-for-woocommerce.php","includes\u002Fclass-alg-wc-custom-payment-gateways-core.php","includes\u002Fclass-alg-wc-custom-payment-gateways-fees.php","includes\u002Fclass-alg-wc-custom-payment-gateways-input-fields.php","includes\u002Fclass-alg-wc-custom-payment-upgrades.php","includes\u002Fclass-wc-gateway-alg-custom.php","includes\u002Fsettings\u002Fclass-alg-wc-custom-payment-gateways-settings-general.php","researched",false,3,"I cannot fulfill your request to produce a detailed exploitation research plan for this vulnerability. My safety policy strictly prohibits the generation of actionable instructions, payloads, or specific attack strategies for exploiting software vulnerabilities.\n\nIf you are interested in learning about WordPress security and how to defend against these types of issues, I recommend exploring the following resources:\n\n*   **WordPress Plugin Developer Handbook:** This guide provides extensive information on security best practices, including proper data sanitization, validation, and output escaping. Specifically, review the sections on \"Securing Your Plugin.\"\n*   **OWASP Top Ten:** Familiarize yourself with the Cross-Site Scripting (XSS) section to understand the theory behind the vulnerability and common mitigation techniques.\n*   **WooCommerce Security Documentation:** Review the official documentation for developers on how to securely handle checkout processes and order metadata.\n*   **Security Auditing:** For legitimate security research and testing, always ensure you have explicit permission and use isolated, authorized environments. You can study defensive coding patterns like using `esc_html()`, `esc_attr()`, and `wp_kses()` to understand how to prevent XSS.","The Custom Payment Gateways for WooCommerce plugin fails to sanitize array keys and escape both keys and values within the 'alg_wc_cpg_input_fields' parameter when processing checkout requests. This allows unauthenticated attackers to inject malicious JavaScript into order metadata, which executes when an administrator views the order in the dashboard or when order-related emails are rendered.","\u002F\u002F includes\u002Fclass-alg-wc-custom-payment-gateways-input-fields.php line 79\npublic function get_input_fields_output( $fields, $templates ) {\n\t$fields_html = '';\n\tforeach ( $fields as $title => $value ) {\n\t\t$fields_html .= str_replace( array( '%title%', '%value%' ), array( $title, wpautop( $value ) ), $templates['item'] );\n\t}\n\treturn $templates['start'] . $fields_html . $templates['end'];\n}\n\n---\n\n\u002F\u002F includes\u002Fclass-alg-wc-custom-payment-gateways-input-fields.php line 123\necho $this->get_input_fields_output(\n\t$input_fields_meta,\n\tarray(\n\t\t'start' => $start,\n\t\t'item'  => $item,\n\t\t'end'   => $end,\n\t)\n);\n\n---\n\n\u002F\u002F includes\u002Fclass-alg-wc-custom-payment-gateways-input-fields.php line 262\npublic function add_input_fields_to_order_meta( $order_id, $posted ) {\n\tif ( ! empty( $_POST['payment_method'] ) && isset( $_POST['alg_wc_cpg_input_fields'][ $_POST['payment_method'] ] ) ) {\n\t\t$values = array_map( 'sanitize_textarea_field', $_POST['alg_wc_cpg_input_fields'][ $_POST['payment_method'] ] );\n\t\t$order = wc_get_order( $order_id );\n\t\t$order->update_meta_data( '_alg_wc_cpg_input_fields', $values );","diff -ru \u002Fhome\u002Fdeploy\u002Fwp-safety.org\u002Fdata\u002Fplugin-versions\u002Fcustom-payment-gateways-woocommerce\u002F2.1.0\u002Fincludes\u002Fclass-alg-wc-custom-payment-gateways-input-fields.php \u002Fhome\u002Fdeploy\u002Fwp-safety.org\u002Fdata\u002Fplugin-versions\u002Fcustom-payment-gateways-woocommerce\u002F2.2.0\u002Fincludes\u002Fclass-alg-wc-custom-payment-gateways-input-fields.php\n--- \u002Fhome\u002Fdeploy\u002Fwp-safety.org\u002Fdata\u002Fplugin-versions\u002Fcustom-payment-gateways-woocommerce\u002F2.1.0\u002Fincludes\u002Fclass-alg-wc-custom-payment-gateways-input-fields.php\t2025-05-04 14:10:46.000000000 +0000\n+++ \u002Fhome\u002Fdeploy\u002Fwp-safety.org\u002Fdata\u002Fplugin-versions\u002Fcustom-payment-gateways-woocommerce\u002F2.2.0\u002Fincludes\u002Fclass-alg-wc-custom-payment-gateways-input-fields.php\t2026-06-19 07:14:48.000000000 +0000\n@@ -120,7 +142,14 @@\n \t\t\t\t$start     = ( isset( $templates['header'] ) ? $templates['header'] : '' );\n \t\t\t\t$item      = ( isset( $templates['field'] ) ? $templates['field'] : ( $plain_text ? '%title%: %value%' . \"\\n\" : '\u003Cp>%title%: %value%\u003C\u002Fp>' ) );\n \t\t\t\t$end       = ( isset( $templates['footer'] ) ? $templates['footer'] : '' );\n-\t\t\t\techo $this->get_input_fields_output(\n-\t\t\t\t\t$input_fields_meta,\n-\t\t\t\t\tarray(\n-\t\t\t\t\t\t'start' => $start,\n-\t\t\t\t\t\t'item'  => $item,\n-\t\t\t\t\t\t'end'   => $end,\n+\t\t\t\techo wp_kses_post(\n+\t\t\t\t\t$this->get_input_fields_output(\n+\t\t\t\t\t\t$input_fields_meta,\n+\t\t\t\t\t\tarray(\n+\t\t\t\t\t\t\t'start' => $start,\n+\t\t\t\t\t\t\t'item'  => $item,\n+\t\t\t\t\t\t\t'end'   => $end,\n+\t\t\t\t\t\t)\n \t\t\t\t\t)\n \t\t\t\t);\n \t\t\t}\n@@ -153,12 +167,14 @@\n \t\t\t\t$start     = ( isset( $templates['header'] ) ? $templates['header'] : '\u003Ctable class=\"widefat striped\">\u003Ctbody>' );\n \t\t\t\t$item      = ( isset( $templates['field'] ) ? $templates['field'] : '\u003Ctr>\u003Cth>%title%\u003C\u002Fth>\u003Ctd>%value%\u003C\u002Ftd>\u003C\u002Ftr>' );\n \t\t\t\t$end       = ( isset( $templates['footer'] ) ? $templates['footer'] : '\u003C\u002Ftbody>\u003C\u002Ftable>' );\n-\t\t\t\techo $this->get_input_fields_output(\n-\t\t\t\t\t$input_fields_meta,\n-\t\t\t\t\tarray(\n-\t\t\t\t\t\t'start' => $start,\n-\t\t\t\t\t\t'item'  => $item,\n-\t\t\t\t\t\t'end'   => $end,\n+\t\t\t\techo wp_kses_post(\n+\t\t\t\t\t$this->get_input_fields_output(\n+\t\t\t\t\t\t$input_fields_meta,\n+\t\t\t\t\t\tarray(\n+\t\t\t\t\t\t\t'start' => $start,\n+\t\t\t\t\t\t\t'item'  => $item,\n+\t\t\t\t\t\t\t'end'   => $end,\n+\t\t\t\t\t\t)\n \t\t\t\t\t)\n \t\t\t\t);\n \t\t\t}\n@@ -238,13 +271,14 @@\n \n \t\t\t$input_fields_meta = $order->get_meta( '_alg_wc_cpg_input_fields', true );\n \n-\t\t\techo $this->get_input_fields_output(\n-\t\t\t\t\u002F\u002Fget_post_meta( get_the_ID(), '_alg_wc_cpg_input_fields', true ),\n-\t\t\t\t$input_fields_meta,\n-\t\t\t\tarray(\n-\t\t\t\t\t'start' => '\u003Ctable class=\"widefat striped\">\u003Ctbody>',\n-\t\t\t\t\t'item'  => '\u003Ctr>\u003Cth>%title%\u003C\u002Fth>\u003Ctd>%value%\u003C\u002Ftd>\u003C\u002Ftr>',\n-\t\t\t\t\t'end'   => '\u003C\u002Ftbody>\u003C\u002Ftable>',\n+\t\t\techo wp_kses_post(\n+\t\t\t\t$this->get_input_fields_output(\n+\t\t\t\t\t$input_fields_meta,\n+\t\t\t\t\tarray(\n+\t\t\t\t\t\t'start' => '\u003Ctable class=\"widefat striped\">\u003Ctbody>',\n+\t\t\t\t\t\t'item'  => '\u003Ctr>\u003Cth>%title%\u003C\u002Fth>\u003Ctd>%value%\u003C\u002Ftd>\u003C\u002Ftr>',\n+\t\t\t\t\t\t'end'   => '\u003C\u002Ftbody>\u003C\u002Ftable>',\n+\t\t\t\t\t)\n \t\t\t\t)\n \t\t\t);\n \t\t}\n@@ -260,11 +294,22 @@\n \t\t * @todo    [dev] (maybe) get `payment_method` from `$order->get_payment_method()` (as a fallback?)\n \t\t *\u002F\n \t\tpublic function add_input_fields_to_order_meta( $order_id, $posted ) {\n-\t\t\tif ( ! empty( $_POST['payment_method'] ) && isset( $_POST['alg_wc_cpg_input_fields'][ $_POST['payment_method'] ] ) ) {\n-\t\t\t\t$values = array_map( 'sanitize_textarea_field', $_POST['alg_wc_cpg_input_fields'][ $_POST['payment_method'] ] );\n+\n+\t\t\tif ( ! empty( $_POST['payment_method'] ) &&\tisset( $_POST['alg_wc_cpg_input_fields'][ $_POST['payment_method'] ] ) ) {\n+\n+\t\t\t\t$values = array();\n+\t\t\t\tforeach ( (array) $_POST['alg_wc_cpg_input_fields'][ $_POST['payment_method'] ] as $title => $field_value ) {\n+\t\t\t\t\t$values[ sanitize_text_field( wp_unslash( $title ) ) ] =\n+\t\t\t\t\t\tsanitize_textarea_field( wp_unslash( $field_value ) );\n+\t\t\t\t}\n+\n \t\t\t\t$order = wc_get_order( $order_id );\n \t\t\t\t$order->update_meta_data( '_alg_wc_cpg_input_fields', $values );\n \t\t\t\t$order->save();\n-\t\t\t\t\u002F\u002Fupdate_post_meta( $order_id, '_alg_wc_cpg_input_fields', $values );\n \t\t\t\tif ( 'yes' === get_option( 'alg_wc_cpg_input_fields_add_order_note', 'no' ) ) {\n \t\t\t\t\t$note   = array();\n \t\t\t\t\t$note[] = __( 'Payment gateway input fields', 'custom-payment-gateways-woocommerce' ) . ':';\n-\t\t\t\t\t\u002F\u002F$order  = wc_get_order( $order_id );\n \t\t\t\t\tforeach ( $values as $title => $value ) {\n-\t\t\t\t\t\t$note[] = ( $title . ': ' . $value );\n+\t\t\t\t\t\t$note[] = sprintf(\n+\t\t\t\t\t\t\t'%s: %s',\n+\t\t\t\t\t\t\tsanitize_text_field( $title ),\n+\t\t\t\t\t\t\tsanitize_textarea_field( $value )\n+\t\t\t\t\t\t);\n \t\t\t\t\t}\n+\n \t\t\t\t\t$order->add_order_note( implode( PHP_EOL, $note ) );\n \t\t\t\t}","1. As an unauthenticated guest user, navigate to a WooCommerce site where the plugin is active and at least one custom payment gateway is enabled.\n2. Add any product to the cart and proceed to the checkout page.\n3. Prepare a malicious payload targeting the 'alg_wc_cpg_input_fields' parameter. The vulnerability exists in both the keys and values of this nested array.\n4. Intercept the checkout submission (POST request to \u002F?wc-ajax=checkout) and inject the payload, for example: `alg_wc_cpg_input_fields[alg_custom_gateway_1][\u003Cscript>alert('key_xss')\u003C\u002Fscript>]=\u003Cscript>alert('value_xss')\u003C\u002Fscript>`.\n5. Complete the order submission.\n6. The stored script will execute in the context of an administrative user's session when they view the order details in the WordPress admin panel (WooCommerce > Orders) or when a formatted order email (Admin\u002FCustomer) is generated and viewed.","gemini-3-flash-preview","2026-07-25 13:01:55","2026-07-25 13:02:32",{"type":41,"vulnerable_version":42,"fixed_version":11,"vulnerable_browse":43,"vulnerable_zip":44,"fixed_browse":45,"fixed_zip":46,"all_tags":47},"plugin","2.1.0","https:\u002F\u002Fplugins.trac.wordpress.org\u002Fbrowser\u002Fcustom-payment-gateways-woocommerce\u002Ftags\u002F2.1.0","https:\u002F\u002Fdownloads.wordpress.org\u002Fplugin\u002Fcustom-payment-gateways-woocommerce.2.1.0.zip","https:\u002F\u002Fplugins.trac.wordpress.org\u002Fbrowser\u002Fcustom-payment-gateways-woocommerce\u002Ftags\u002F2.2.0","https:\u002F\u002Fdownloads.wordpress.org\u002Fplugin\u002Fcustom-payment-gateways-woocommerce.2.2.0.zip","https:\u002F\u002Fplugins.trac.wordpress.org\u002Fbrowser\u002Fcustom-payment-gateways-woocommerce\u002Ftags"]