We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1bc1bbc commit 20391a4Copy full SHA for 20391a4
sourcefiles/modern/plugins/jquery/jquery-ui-1.12.1.js
@@ -8847,7 +8847,12 @@ $.extend( Datepicker.prototype, {
8847
var altFormat, date, dateStr,
8848
altField = this._get( inst, "altField" );
8849
8850
- if ( altField ) { // update alternate field too
+ // Mitigation for potential XSS: only allow altField as a selector, not as HTML
8851
+ if (
8852
+ typeof altField === "string" &&
8853
+ altField.length > 0 &&
8854
+ altField.trim().charAt(0) !== "<"
8855
+ ) { // update alternate field too
8856
altFormat = this._get( inst, "altFormat" ) || this._get( inst, "dateFormat" );
8857
date = this._getDate( inst );
8858
dateStr = this.formatDate( altFormat, date, this._getFormatConfig( inst ) );
0 commit comments