From 1e8df62cbfb6569d7d20c1e42236c6570fc6f6a9 Mon Sep 17 00:00:00 2001 From: Yogesh Ojha Date: Tue, 4 Feb 2025 08:25:51 +0530 Subject: [PATCH] fix all instances of xss in list target page --- web/targetApp/templates/target/list.html | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/web/targetApp/templates/target/list.html b/web/targetApp/templates/target/list.html index db287e4ab..dd4cfcb66 100644 --- a/web/targetApp/templates/target/list.html +++ b/web/targetApp/templates/target/list.html @@ -165,11 +165,11 @@

Filters

{ "render": function(data, type, row) { var content = ''; - content += `${data}  (view whois)`; + content += `${htmlEncode(data)}  (view whois)`; if (row.organization) { content += '
'; for (var org in row.organization) { - content += `${row.organization[org]}`; + content += `${htmlEncode(row.organization[org])}`; } } @@ -179,13 +179,19 @@

Filters

// if bounty mode is enabled show target hackerone handle, when clicked must take to hackerone program {% if user_preferences.bug_bounty_mode %} - content += `
${row.h1_team_handle}`; + content += `
${htmlEncode(row.h1_team_handle)}`; {% endif %} return content; }, "targets": 2, }, + { + "render": function(data, type, row) { + return htmlEncode(data); + }, + "targets": 3, + }, { "render": function(data, type, row) { var content = '
'; @@ -233,7 +239,7 @@

Filters

  Schedule Scan   Edit Target -   Delete target +   Delete target