Skip to content

Commit 6a5b72b

Browse files
committed
[FIX] Sanitize modification-history entries in alert history modal
user and action come from modification_history, which embeds the acting user's username verbatim. They were appended as raw HTML via jQuery .append(), so a username containing HTML/script executed when an analyst opened the alert history modal.
1 parent d393c1d commit 6a5b72b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

ui/src/pages/alerts.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1294,7 +1294,7 @@ async function showAlertHistory(alertId) {
12941294
let date = new Date(Math.floor(entry) * 1000);
12951295
let dateStr = date.toLocaleString();
12961296
let entryStr = alertData.modification_history[entry];
1297-
entryDiv.append('<div class="row"><div class="col-3">' + dateStr + '</div><div class="col-3">' + entryStr.user + '</div><div class="col-6">'+ entryStr.action +'</div></div>');
1297+
entryDiv.append('<div class="row"><div class="col-3">' + dateStr + '</div><div class="col-3">' + sanitizeHTML(entryStr.user) + '</div><div class="col-6">'+ sanitizeHTML(entryStr.action) +'</div></div>');
12981298

12991299
}
13001300

0 commit comments

Comments
 (0)