Skip to content

Commit

Permalink
Potential XSS fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jsokol committed Mar 6, 2021
1 parent 267f37d commit 591405b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion simplerisk/js/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,11 @@ function checkAndSetValidation(container)
issue_el.addClass("error");
issue_el.focus()
}
var message = field_required_lang.replace("_XXX_", issue_el.attr("title"))

// We have to make sure that no html gets through to toastr as it's displaying what it gets 'as is';
var escaped = $("<div/>").text(issue_el.attr("title")).html();
var message = field_required_lang.replace("_XXX_", escaped);

showAlertFromMessage(message, false)
}
return false;
Expand Down

0 comments on commit 591405b

Please sign in to comment.