N°8205 - Security hardening

This commit is contained in:
Stephen Abello
2025-05-20 09:48:00 +02:00
parent d72e861dfe
commit a5545b0084

View File

@@ -156,8 +156,17 @@
return row.attributes[attribute_code].sort_value;
},
filter: function (attribute_code, type, row) {
return $.text($.parseHTML(row.attributes[attribute_code]['value_html']));
},
// Check if the attribute and value_html exist
if (!row.attributes[attribute_code] || !row.attributes[attribute_code]['value_html']) {
return '';
}
// Create a temporary div outside the DOM to filter out XSS
const tempDiv = document.createElement('div');
tempDiv.textContent = row.attributes[attribute_code]['value_html'];
return tempDiv.textContent;
},
},
});
}