CVE-2015-10132: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (CWE-79)
value: A vulnerability classified as problematic was found in Thimo Grauerholz WP-Spreadplugin up to 3.8.6.1 on WordPress. This vulnerability affects unknown code of the file spreadplugin.php. The manipulation of the argument Spreadplugin leads to cross site scripting. The attack can be initiated remotely. Upgrading to version 3.8.6.6 is able to address this issue. The name of the patch is a9b9afc641854698e80aa5dd9ababfc8e0e57d69. It is recommended to upgrade the affected component. The identifier of this vulnerability is VDB-261676.
CWE description: The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
Published: 2024-04-21T20:15Z
Repository: https://github.com/wp-plugins/wp-spreadplugin
Language: JavaScript
Files changed: js/spreadplugin.min.js, readme.txt, spreadplugin.php
Commit date: 2015-04-21 19:20:06 +0000
Commit message: One XSS vulnerability fixed

git-svn-id: https://plugins.svn.wordpress.org/wp-spreadplugin/trunk@1141104 b8457f37-d9ea-0310-8a92-e5e31aec5664

Diff: diff --git a/js/spreadplugin.min.js b/js/spreadplugin.min.js
index f9ed40a..914b242 100644
--- a/js/spreadplugin.min.js
+++ b/js/spreadplugin.min.js
@@ -1,10 +1,10 @@
 /**
  * Plugin Name: WP-Spreadplugin
  * Plugin URI: http://wordpress.org/extend/plugins/wp-spreadplugin/
  * Description: This plugin uses the Spreadshirt API to list articles and let your customers order articles of your Spreadshirt shop using Spreadshirt order process.
- * Version: 3.8.6.1
+ * Version: 3.8.6.2
  * Author: Thimo Grauerholz
  * Author URI: http://www.spreadplugin.de
  */
 
 jQuery(function(e){function f(){e(".spreadplugin-article .colors li,.spreadplugin-article-detail .colors li").unbind();e(".spreadplugin-article .views li,.spreadplugin-article-detail .views li").unbind();e(".spreadplugin-article .description-wrapper div.header,.spreadplugin-article-detail .description-wrapper div.header").unbind();e(".spreadplugin-article .product-description-wrapper div.header,.spreadplugin-article-detail .product-description-wrapper div.header").unbind();e(".spreadplugin-design .image-wrapper").unbind();e(".spreadplugin-article form,.spreadplugin-article-detail form").unbind();e(".spreadplugin-article .edit-wrapper a,.spreadplugin-article-detail .edit-wrapper a").unbind();e(".spreadplugin-article .edit-wrapper-integrated a,.spreadplugin-article-detail .edit-wrapper-integrated a").unbind();e(".spreadplugin-article .details-wrapper a,.spreadplugin-article-detail .details-wrapper a").unbind();e(".spreadplugin-article .image-wrapper,.spreadplugin-article-detail .image-wrapper").unbind();e(".spreadplugin-article .shipping-window,.spreadplugin-article-detail .shipping-window").unbind();e(".spreadplugin-article .colors li,.spreadplugin-article-detail .colors li").click(function(){var t="#"+e(this).closest(".spreadplugin-article,.spreadplugin-article-detail").attr("id");var n=e(t+" img.preview");var r=n.attr("src");var i=n.attr("data-zoom-image");var s=n.data("elevateZoom");o=e(this).attr("value");u=e(t+" #view").val();e(t+" #appearance").val(o);n.attr("src",n.attr("src").replace(/\,appearanceId=(\d+)/g,"")+",appearanceId="+o);n.attr("data-zoom-image",i.replace(/\,appearanceId=(\d+)/g,"").replace(/\,viewId=(\d+)/g,"")+",appearanceId="+o+",viewId="+u);e(t+" img.previewview").each(function(){var t=e(this).attr("src");e(this).attr("src",t.replace(/\,appearanceId=(\d+)/g,"")+",appearanceId="+o)});if(s){var a=s.imageSrc.replace(/\,appearanceId=(\d+)/g,"").replace(/\,viewId=(\d+)/g,"");a=a+",appearanceId="+o+",viewId="+u;s.imageSrc=a;s.zoomImage=a;s.currentImage=a;if(s.zoomWindow){s.zoomWindow.css({backgroundImage:"url('"+a+"')"})}if(s.zoomLens){s.zoomLens.css({backgroundImage:"url('"+a+"')"})}}});e(".spreadplugin-article .views li,.spreadplugin-article-detail .views li").click(function(){var t="#"+e(this).closest(".spreadplugin-article,.spreadplugin-article-detail").attr("id");var n=e(t+" img.preview");var r=n.attr("src");var i=n.attr("data-zoom-image");var s=n.data("elevateZoom");u=e(this).attr("value");o=e(t+" #appearance").val();e(t+" #view").val(u);n.attr("src",r.replace(/\,viewId=(\d+)/g,"").replace(/width=(\d+)/g,"width="+Math.round(n.width())).replace(/height=(\d+)/g,"height="+Math.round(n.height()))+",viewId="+u);n.attr("data-zoom-image",i.replace(/\,appearanceId=(\d+)/g,"").replace(/\,viewId=(\d+)/g,"")+",appearanceId="+o+",viewId="+u);if(s){var a=s.imageSrc.replace(/\,appearanceId=(\d+)/g,"").replace(/\,viewId=(\d+)/g,"");a=a+",appearanceId="+o+",viewId="+u;s.imageSrc=a;s.zoomImage=a;s.currentImage=a;if(s.zoomWindow){s.zoomWindow.css({backgroundImage:"url('"+a+"')"})}if(s.zoomLens){s.zoomLens.css({backgroundImage:"url('"+a+"')"})}}});e(".spreadplugin-article .description-wrapper div.header,.spreadplugin-article-detail .description-wrapper div.header").click(function(){var t=e(this).parent().parent().parent();var n=e(this).next();if(n.is(":hidden")){t.addClass("activeDescription");n.show();e(this).children("a").html(textHideDesc)}else{t.removeClass("activeDescription");e(".description-wrapper div.description").hide();e(".description-wrapper div.header a").html(textShowDesc)}});e(".spreadplugin-article .product-description-wrapper div.header,.spreadplugin-article-detail .description-wrapper div.header").click(function(){var t=e(this).parent().parent().parent();var n=e(this).next();if(n.is(":hidden")){t.addClass("activeDescription");n.show();e(this).children("a").html(textProdHideDesc)}else{t.removeClass("activeDescription");e(".product-description-wrapper div.description").hide();e(".product-description-wrapper div.header a").html(textProdShowDesc)}});e(".spreadplugin-article form,.spreadplugin-article-detail form").submit(function(t){t.preventDefault();var n=e(this).serialize()+"&action=myAjax";var r=this;var i=e("#"+r.id+" input[type=submit]").not(".add-basket-button");var s=r.id.split("_");var o=s[1];var u=e("#previewimg_"+o).width()/3;var a=e("#previewimg_"+o).height()/3;var f=e("#previewimg_"+o).offset().left;var l=e("#previewimg_"+o).offset().top;var c=e(".spreadplugin-checkout").offset().left;var h=e(".spreadplugin-checkout").offset().top;var p=c-f;var m=h-l;i.val(textButtonAdded);e("#article_"+o+" img.preview").clone().prependTo("#article_"+o).css({position:"absolute"}).css({"z-index":"1008"}).animate({opacity:.9},100).animate({opacity:.1,marginLeft:p,marginTop:m,width:u,height:a},1200,function(){e.post(ajaxLocation,n,function(e){if(e.c.m==1){i.val(textButtonAdd)}else{i.val(textButtonFailed)}d(e);v()},"json");e(this).remove()});return false});e(".spreadplugin-article .shipping-window,.spreadplugin-article-detail .shipping-window").magnificPopup({items:{src:"#spreadplugin-shipment-wrapper"},type:"inline",callbacks:{open:function(){e("#spreadplugin-shipment-wrapper").show();e("#spreadplugin-shipment-wrapper").parent(".mfp-content").css("width",400)},close:function(){e("#spreadplugin-shipment-wrapper").hide()}}});e(".spreadplugin-article .edit-wrapper-integrated,.spreadplugin-article-detail .edit-wrapper-integrated").click(function(){var t=e(this).data("designid");var n=e(this).data("productid");var r=e(this).data("viewid");var i=e(this).data("appearanceid");var s=e(this).data("producttypeid");e.magnificPopup.open({items:{type:"inline",src:"#spreadplugin-designer-wrapper"},callbacks:{open:function(){e(".mfp-iframe-holder .mfp-content").css("height",e(window).height()-200);m(t,n,r,i,s)},resize:function(){e(".mfp-iframe-holder .mfp-content").css("height",e(window).height()-200)}}})});if(pageCheckoutUseIframe==2){e(".spreadplugin-article .edit-wrapper a,.spreadplugin-article-detail .edit-wrapper a").magnificPopup({type:"iframe",callbacks:{open:function(){e(".mfp-iframe-holder .mfp-content").css("height",e(window).height()-200)},resize:function(){e(".mfp-iframe-holder .mfp-content").css("height",e(window).height()-200)}}});e(".spreadplugin-article .details-wrapper a,.spreadplugin-article-detail .details-wrapper a").magnificPopup({type:"iframe",preloader:true})}e(".spreadplugin-article:not(.min-view) .image-wrapper a,.spreadplugin-article-detail .image-wrapper a").magnificPopup({type:"iframe",preloader:true});e(".spreadplugin-design .image-wrapper").click(function(){var t=e(this).parent().attr("id");t="#"+t.replace("design","designContainer");if(e(t).is(":hidden")){e(t).addClass("active");e(t).slideDown("slow")}else{e("#spreadplugin-list .design-container").slideUp("slow",function(){e(this).removeClass("active")})}})}function l(){e(".spreadplugin-article img.preview,.spreadplugin-article-detail img.preview").unbind();e("div.spreadplugin-article.min-view").unbind();e(".spreadplugin-design div.image-wrapper").each(function(){e(this).hover(function(){e(this).find(".img-caption").stop(true).css("display","inline-block").animate({top:-50},{queue:false,duration:400})},function(){e(this).find(".img-caption").stop(true).hide().animate({top:0})})});if(zoomActivated==1){e(".spreadplugin-article img.preview,.spreadplugin-article-detail img.preview").hover(function(){e(this).elevateZoom(zoomConfig)})}e(".spreadplugin-article ul.soc-icons a,.spreadplugin-article-detail ul.soc-icons a").hover(function(){e(this).parent().css("background-color",e(this).attr("data-color"))},function(){e(this).parent().removeAttr("style")});e("div.spreadplugin-article.min-view").hover(function(){e(this).addClass("active")},function(){e(this).removeClass("active")});if(!e.browser.msie||parseInt(e.browser.version,10)>8){var t=1;e("div.spreadplugin-article.min-view").css("opacity",t).hover(function(){e(this).prevAll().stop().not(".clear,#infscr-loading").fadeTo("slow",.6);e(this).nextAll().stop().not(".clear,#infscr-loading").fadeTo("slow",.6)},function(){e(this).prevAll().stop().not(".clear,#infscr-loading").fadeTo("slow",t);e(this).nextAll().stop().not(".clear,#infscr-loading").fadeTo("slow",t)})}}function p(e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var t="[\\?&]"+e+"=([^&#]*)";var n=new RegExp(t);var r=n.exec(window.location.search);if(r==null){return""}else{return encodeURIComponent(decodeURIComponent(r[1].replace(/\+/g," ")))}}function d(t){e(".spreadplugin-checkout a").attr("href",t.c.u);e(".spreadplugin-checkout a").removeAttr("title");e(".spreadplugin-checkout span").text(t.c.q);e(".spreadplugin-cart-checkout a").attr("href",t.c.u);e.get(ajaxLocation,"action=myCart",function(t){e(".spreadplugin-cart").html(t);if(pageCheckoutUseIframe==1){e(".spreadplugin-cart-checkout a").click(function(t){t.preventDefault();var n=e(this).attr("href");if(typeof n!=="undefined"&&n.length>0){e("#spreadplugin-items #pagination").remove();e("#spreadplugin-items #spreadplugin-menu").remove();e(window).unbind(".infscr");e("#spreadplugin-list").html('<iframe style="z-index:10002" id="checkoutFrame" frameborder="0" width="900" height="2000" scroll="yes">');e("#spreadplugin-list #checkoutFrame").attr("src",n);e("html, body").animate({scrollTop:e("#spreadplugin-items #checkoutFrame").offset().top},2e3)}})}if(pageCheckoutUseIframe==2){var n=e(".spreadplugin-cart-checkout a").attr("href");if(typeof n!=="undefined"&&n.length>0){e(".spreadplugin-cart-checkout a").magnificPopup({type:"iframe",callbacks:{close:function(){location.reload();return}}})}}e(".cart-row a.deleteCartItem").click(function(t){t.preventDefault;e(this).closest(".cart-row").show().fadeOut("slow");e.post(ajaxLocation,"action=myDelete&id="+e(this).closest(".cart-row").data("id"),function(){})})})}function v(){e.get(ajaxLocation,"action=mergeBasket",function(e){},"json")}function m(t,n,r,i,s){if(e("#Confomat").length){designerTargetId="Confomat"}confomat.create({shopId:designerShopId,targetId:designerTargetId,platform:designerPlatform,locale:designerLocale,width:designerWidth,designId:t,productId:n,appearanceId:i,viewId:r,productTypeId:s,calculatePriceFunction:function(e,t){return e.price*1.5},addToBasketFunction:function(t,n){var r={article:t.productId,size:t.sizeId,appearance:t.appearanceId,quantity:t.quantity,shopId:t.shopId,action:"myAjax",type:"1"};e.post(ajaxLocation,r,function(e){if(e.c.m==1){n(true)}else{n(false)}d(e)},"json")},checkoutFunction:function(){e(".spreadplugin-checkout-link").trigger("click")}},{className:"conformat-designer"},function(e,t){if(e){e=e===true?"Some error occurred":e;alert(e)}else{a=t}})}var t="?";var n=p("productCategory");var r=p("productSubCategory");var i=p("articleSortBy");var s=".spreadplugin-article";var o="";var u="";var a;if(display==1){s=".spreadplugin-designs"}if(pageLink.indexOf("?")>-1){t="&"}e(".spreadplugin-cart").hide();e(document).click(function(t){if(t.target.className!="spreadplugin-checkout-link"&&t.target.className!="spreadplugin-checkout-link button"&&e(".spreadplugin-cart").is(":visible")&&!e(".spreadplugin-cart").find(t.target).length){e(".spreadplugin-cart").hide()}});e(".spreadplugin-items select").hover(function(e){e.stopPropagation()});v();var c=e.browser=="msie"&&e.browser.version<7;if(!c&&e(".spreadplugin-menu").length!=0){var h=e("#spreadplugin-menu").offset().top-parseFloat(e("#spreadplugin-menu").css("margin-top").replace(/auto/,0));e(window).scroll(function(t){var n=e(this).scrollTop();if(n>=h-0){e("#spreadplugin-menu").addClass("fixed");e("#spreadplugin-menu").css("width",e("div.spreadplugin-items").width())}else{e("#spreadplugin-menu").css("width","");e("#spreadplugin-menu").removeClass("fixed")}})}e(window).resize(function(){e(".img-caption").hide()});if(infiniteScroll==1){e("#spreadplugin-list").infinitescroll({nextSelector:"#spreadplugin-items #pagination a",navSelector:"#spreadplugin-items #pagination",itemSelector:"#spreadplugin-list "+s,loading:{img:loadingImage,msgText:loadingMessage,finishedMsg:loadingFinishedMessage},animate:true,debug:false,bufferPx:40},function(t){f();l();if(lazyLoad==1){e("img.lazyimg").lazyload({effect:"fadeIn"})}})}e("#spreadplugin-items #productCategory").change(function(){n=e(this).val();document.location=pageLink+t+"productCategory="+n+"&articleSortBy="+i});e("#spreadplugin-items #productSubCategory").change(function(){r=e(this).val();document.location=pageLink+t+"productCategory="+n+"&productSubCategory="+r+"&articleSortBy="+i});e("#spreadplugin-items #articleSortBy").change(function(){i=e(this).val();document.location=pageLink+t+"productCategory="+n+"&productSubCategory="+r+"&articleSortBy="+i});e(".spreadplugin-checkout-link").click(function(t){t.preventDefault();var n=e(this).parent().next(".spreadplugin-cart");if(n.is(":hidden")){n.show()}else{n.hide()}});e.post(ajaxLocation,"action=myAjax",function(e){d(e)},"json");setInterval(function(){e.post(ajaxLocation,"action=myAjax",function(e){d(e)},"json")},1e4);f();l();if(lazyLoad==1){e("img.lazyimg").lazyload({effect:"fadeIn"})}e("#spreadplugin-tabs li").click(function(){e("#spreadplugin-tabs li").removeClass("active");e(this).addClass("active");e(".spreadplugin-tab_content").hide();e(e(this).find("a").attr("href")).fadeIn();return false})})
\ No newline at end of file
diff --git a/readme.txt b/readme.txt
index 0e6d202..7a48482 100644
--- a/readme.txt
+++ b/readme.txt
@@ -3,11 +3,11 @@ Contributors: Thimo Grauerholz
 Author: Thimo Grauerholz
 Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=EZLKTKW8UR6PQ
 Tags: spreadshirt,wordpress,plugin,shop,store,shirt,t-shirt,integration,online store,online shop
 Requires at least: 3.3
 Tested up to: 4.1
-Stable tag: 3.8.6.1
+Stable tag: 3.8.6.2
 License: GPLv2 or later
 License URI: http://www.gnu.org/licenses/gpl-2.0.html
 
 This plugin uses the Spreadshirt API to list articles and let your customers order articles of your Spreadshirt shop using Spreadshirt order process.
 
@@ -193,10 +193,13 @@ Please have a look here: http://themeforest.net/category/wordpress?ref=thimo
 2. Article view
 3. Settings page
 
 == Changelog ==
 
+= 3.8.6.2 =
+* One XSS vulnerability fixed
+
 = 3.8.6 =
 * CSS fixes
 
 = 3.8.5 =
 * Changes in Spreadshirt API
diff --git a/spreadplugin.php b/spreadplugin.php
index d347fc7..2f38575 100644
--- a/spreadplugin.php
+++ b/spreadplugin.php
@@ -1,11 +1,11 @@
 <?php
 /**
  * Plugin Name: WP-Spreadplugin
  * Plugin URI: http://wordpress.org/extend/plugins/wp-spreadplugin/
  * Description: This plugin uses the Spreadshirt API to list articles and let your customers order articles of your Spreadshirt shop using Spreadshirt order process.
- * Version: 3.8.6.1
+ * Version: 3.8.6.2
  * Author: Thimo Grauerholz
  * Author URI: http://www.spreadplugin.de
  */
 @set_time_limit(0);
 
@@ -477,11 +477,11 @@ if (!class_exists('WP_Spreadplugin')) {
 
                         $output .= '</div>';
 
                         $output .= "<div id=\"pagination\">";
                         if ($cArticleNext > 0) {
-                            $output .= "<a href=\"" . add_query_arg('pagesp', $paged + 1) . "\">" . __('next', $this->stringTextdomain) . "</a>";
+                            $output .= "<a href=\"" . add_query_arg('pagesp', $paged + 1, get_permalink()) . "\">" . __('next', $this->stringTextdomain) . "</a>";
                         }
                         $output .= "</div>";
                     } else {
 
                         // display product page

Vulnerable code:  * Version: 3.8.6.1
Stable tag: 3.8.6.1
 * Version: 3.8.6.1
                            $output .= "<a href=\"" . add_query_arg('pagesp', $paged + 1) . "\">" . __('next', $this->stringTextdomain) . "</a>";
Fixed code:  * Version: 3.8.6.2
Stable tag: 3.8.6.2
= 3.8.6.2 =
* One XSS vulnerability fixed

 * Version: 3.8.6.2
                            $output .= "<a href=\"" . add_query_arg('pagesp', $paged + 1, get_permalink()) . "\">" . __('next', $this->stringTextdomain) . "</a>";