I am running Synopsys' Coverity scanning tool and it says the following function needs to sanitize "success". I have tried DomPurify, DomParser etc and all it does is break the UI. Any help would be wonderful.
$.ajax({
url: window.paramFormRoleView.UrlGetIsoData,
success: function (response) {
bindIsosDropDown(response);
}
});
Here is the function for bindIsosDropDown
function bindIsosDropDown(isoData) {
var isoDropDownHtml = "";
if (window.existingAssociatedIsos !== null && window.existingAssociatedIsos !== "") {
var existingAssociatedIsosArr = window.existingAssociatedIsos.split(',').map(Number);
$(isoData).each(function (index, iso) {
isoDropDownHtml += '<option value="' + iso.IsoId + '"' + (($.inArray(iso.IsoId, existingAssociatedIsosArr) > -1) ? 'Selected' : '') + '>' + iso.LegalName + '</option>';
});
} else {
$(isoData).each(function (index, iso) {
isoDropDownHtml += '<option value="' + iso.IsoId + '">' + iso.LegalName + '</option>';
});
}
$("#ddlIsoList").html(isoDropDownHtml);
$(".multiselect").multiselect({ noneSelectedText: 'Select ISO' });
manageIsosAndRoles();
}