Skip to content

Commit

Permalink
#3050 XSS in Reports names
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrykb0802 committed Nov 19, 2024
1 parent 1d32f18 commit 527fd1f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions WebContent/WEB-INF/jsp/reports.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
for (var i=0; i<response.data.reports.length; i++) {
appendReport(response.data.reports[i].id);
updateReport(response.data.reports[i].id, escapeHtml(response.data.reports[i].name));
updateReport(response.data.reports[i].id, response.data.reports[i].name);
}
<c:if test="${!empty param.wlid}">
Expand Down Expand Up @@ -301,8 +301,7 @@
function saveReport() {
startImageFader("saveImg");
let name = escapeHtml($get("name"));
ReportsDwr.saveReport(selectedReport.id, name, reportPointsContext.convertToSave(), $get("includeEvents"),
ReportsDwr.saveReport(selectedReport.id, $get("name"), reportPointsContext.convertToSave(), $get("includeEvents"),
$get("includeUserComments"), $get("dateRangeType"), $get("relativeType"), $get("prevPeriodCount"),
$get("prevPeriodType"), $get("pastPeriodCount"), $get("pastPeriodType"), $get("fromNone"),
$get("fromYear"), $get("fromMonth"), $get("fromDay"), $get("fromHour"), $get("fromMinute"),
Expand All @@ -326,7 +325,7 @@
}
else
showMessage("userMessage", "<spring:message code="reports.reportSaved"/>");
updateReport(selectedReport.id, name);
updateReport(selectedReport.id, $get("name"));
}
});
startImageFader("saveImg");
Expand All @@ -337,7 +336,8 @@
}
function updateReport(id, name) {
$("r"+ id +"Name").innerHTML = name;
let escapedName = escapeHtml(name);
$("r"+ id +"Name").innerHTML = escapedName;
}
function clearMessages() {
Expand Down

0 comments on commit 527fd1f

Please sign in to comment.