Skip to content

Commit

Permalink
Fix #1439: File Upload XSS Vulnerability
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware committed Apr 1, 2017
1 parent 2447c28 commit 774be67
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1773,13 +1773,13 @@ PrimeFaces.widget.FileUpload = PrimeFaces.widget.BaseWidget.extend({
if(validMsg) {
$this.showMessage({
summary: validMsg,
filename: file.name,
filename: PrimeFaces.escapeHTML(file.name),
filesize: file.size
});
}
else {
var row = $('<div class="ui-fileupload-row"></div>').append('<div class="ui-fileupload-preview"></td>')
.append('<div>' + file.name + '</div>')
.append('<div>' + PrimeFaces.escapeHTML(file.name) + '</div>')
.append('<div>' + $this.formatSize(file.size) + '</div>')
.append('<div class="ui-fileupload-progress"></div>')
.append('<div><button class="ui-fileupload-cancel ui-button ui-widget ui-state-default ui-corner-all ui-button-icon-only"><span class="ui-button-icon-left ui-icon ui-icon ui-icon-close"></span><span class="ui-button-text">ui-button</span></button></div>')
Expand Down Expand Up @@ -2190,7 +2190,7 @@ PrimeFaces.widget.SimpleFileUpload = PrimeFaces.widget.BaseWidget.extend({
});

this.input.on('change.fileupload', function() {
var filename = $this.input.val().replace(/\\/g, '/').replace(/.*\//, '');
var filename = PrimeFaces.escapeHTML($this.input.val().replace(/\\/g, '/').replace(/.*\//, ''));
$this.display.text(filename);
})
.on('focus.fileupload', function() {
Expand Down

0 comments on commit 774be67

Please sign in to comment.