From b6ef191f20885e4d1dedcce99dd83b6b3e37b0e1 Mon Sep 17 00:00:00 2001 From: huangtianhua Date: Mon, 23 May 2022 17:21:03 +0800 Subject: [PATCH] Fix CVE-2021-41183 --- ...option-are-text-shorten-HTML-strings.patch | 180 ++++++++++++++++++ python-XStatic-jquery-ui.spec | 8 +- 2 files changed, 186 insertions(+), 2 deletions(-) create mode 100644 0001-Make-sure-text-option-are-text-shorten-HTML-strings.patch diff --git a/0001-Make-sure-text-option-are-text-shorten-HTML-strings.patch b/0001-Make-sure-text-option-are-text-shorten-HTML-strings.patch new file mode 100644 index 0000000..5fce851 --- /dev/null +++ b/0001-Make-sure-text-option-are-text-shorten-HTML-strings.patch @@ -0,0 +1,180 @@ +diff --git a/xstatic/pkg/jquery_ui/data/jquery-ui.js b/xstatic/pkg/jquery_ui/data/jquery-ui.js +index 264329f..531b3bd 100644 +--- a/xstatic/pkg/jquery_ui/data/jquery-ui.js ++++ b/xstatic/pkg/jquery_ui/data/jquery-ui.js +@@ -9801,7 +9801,9 @@ $.extend( Datepicker.prototype, { + inst.append.remove(); + } + if ( appendText ) { +- inst.append = $( "" + appendText + "" ); ++ inst.append = $( "" ) ++ .addClass( this._appendClass ) ++ .text( appendText ); + input[ isRTL ? "before" : "after" ]( inst.append ); + } + +@@ -9818,12 +9820,32 @@ $.extend( Datepicker.prototype, { + if ( showOn === "button" || showOn === "both" ) { // pop-up date picker when button clicked + buttonText = this._get( inst, "buttonText" ); + buttonImage = this._get( inst, "buttonImage" ); +- inst.trigger = $( this._get( inst, "buttonImageOnly" ) ? +- $( "" ).addClass( this._triggerClass ). +- attr( { src: buttonImage, alt: buttonText, title: buttonText } ) : +- $( "" ).addClass( this._triggerClass ). +- html( !buttonImage ? buttonText : $( "" ).attr( +- { src:buttonImage, alt:buttonText, title:buttonText } ) ) ); ++ ++ if ( this._get( inst, "buttonImageOnly" ) ) { ++ inst.trigger = $( "" ) ++ .addClass( this._triggerClass ) ++ .attr( { ++ src: buttonImage, ++ alt: buttonText, ++ title: buttonText ++ } ); ++ } else { ++ inst.trigger = $( "" : "" ); +- +- buttonPanel = ( showButtonPanel ) ? "
" + ( isRTL ? controls : "" ) + +- ( this._isInRange( inst, gotoDate ) ? "" : "" ) + ( isRTL ? "" : controls ) + "
" : ""; ++ controls = ""; ++ if ( !inst.inline ) { ++ controls = $( "