r81155 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r81154‎ | r81155 | r81156 >
Date:19:50, 28 January 2011
Author:catrope
Status:ok
Tags:
Comment:
ProofreadPage: Fix stored XSS in edit form. Report and patch by Bawolff
Modified paths:
  • /trunk/extensions/ProofreadPage/proofread.js (modified) (history)

Diff [purge]

Index: trunk/extensions/ProofreadPage/proofread.js
@@ -117,25 +117,20 @@
118118 pageFooter = pageFooter.substr( 0, pageFooter.length - 6 );
119119 }
120120
121 - // escape & character
122 - pageBody = pageBody.split( '&' ).join( '&' );
123 - pageHeader = pageHeader.split( '&' ).join( '&' );
124 - pageFooter = pageFooter.split( '&' ).join( '&' );
125 -
126121 container.innerHTML = '' +
127122 '<div id="prp_header" style="">' +
128123 '<span style="color:gray;font-size:80%;line-height:100%;">' +
129124 escapeQuotesHTML( mediaWiki.msg( 'proofreadpage_header' ) ) + '</span>' +
130 - '<textarea name="wpHeaderTextbox" rows="2" cols="80" tabindex=1>' + pageHeader + '</textarea><br />' +
 125+ '<textarea name="wpHeaderTextbox" rows="2" cols="80" tabindex=1>' + escapeQuotesHTML( pageHeader ) + '</textarea><br />' +
131126 '<span style="color:gray;font-size:80%;line-height:100%;">' +
132127 escapeQuotesHTML( mediaWiki.msg( 'proofreadpage_body' ) ) + '</span></div>' +
133128 '<textarea name="wpTextbox1" id="wpTextbox1" tabindex=1 style="height:' + ( self.DisplayHeight - 6 ) + 'px;">' +
134 - pageBody + '</textarea>' +
 129+ escapeQuotesHTML( pageBody ) + '</textarea>' +
135130 '<div id="prp_footer" style="">' +
136131 '<span style="color:gray;font-size:80%;line-height:100%;">' +
137132 escapeQuotesHTML( mediaWiki.msg( 'proofreadpage_footer' ) ) + '</span><br />' +
138133 '<textarea name="wpFooterTextbox" rows="2" cols="80" tabindex=1>' +
139 - pageFooter + '</textarea></div>';
 134+ escapeQuotesHTML( pageFooter ) + '</textarea></div>';
140135 }
141136
142137 function pr_reset_size() {
@@ -951,13 +946,13 @@
952947
953948 if( !proofreadPageAddButtons ) {
954949 f.innerHTML =
955 - ' <input type="hidden" name="wpProofreader" value="' + self.proofreadpage_username + '">' +
956 - '<input type="hidden" name="quality" value=' + self.proofreadpage_quality + ' >';
 950+ ' <input type="hidden" name="wpProofreader" value="' + escapeQuotesHTML( self.proofreadpage_username ) + '">' +
 951+ '<input type="hidden" name="quality" value="' + escapeQuotesHTML( self.proofreadpage_quality ) + '" >';
957952 return;
958953 }
959954
960955 f.innerHTML =
961 -' <input type="hidden" name="wpProofreader" value="' + self.proofreadpage_username + '">'
 956+' <input type="hidden" name="wpProofreader" value="' + escapeQuotesHTML( self.proofreadpage_username ) + '">'
962957 +'<span class="quality0"> <input type="radio" name="quality" value=0 onclick="pr_add_quality(this.form,0)" tabindex=4> </span>'
963958 +'<span class="quality2"> <input type="radio" name="quality" value=2 onclick="pr_add_quality(this.form,2)" tabindex=4> </span>'
964959 +'<span class="quality1"> <input type="radio" name="quality" value=1 onclick="pr_add_quality(this.form,1)" tabindex=4> </span>'

Follow-up revisions

RevisionCommit summaryAuthorDate
r811561.16wmf4: MFT r81155catrope19:54, 28 January 2011
r813941.17: MFT r81026, r81116, r81155, r81201, r81204, r81205, r81220, r81235, r81...catrope15:33, 2 February 2011

Status & tagging log