Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ui): stored XSS #180

Merged
merged 1 commit into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
bug(ui): fix xss stored
  • Loading branch information
psyray committed Aug 29, 2024
commit 3241f76c39c58989357da528ddda7b5f951e4864
15 changes: 15 additions & 0 deletions web/startScan/static/startScan/js/detail_scan.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,12 @@ function get_endpoints(project, scan_history_id=null, domain_id=null, gf_tags=nu
},
"targets": 2,
},
{
"render": function ( data, type, row ) {
return htmlEncode(data);
},
"targets": 3,
},
{
"render": function ( data, type, row ) {
if (data){
Expand Down Expand Up @@ -345,6 +351,15 @@ function get_subdomain_changes(scan_history_id){
},
"targets": 0
},
{
"render": function ( data, type, row ) {
if (data){
return htmlEncode(data);
}
return "";
},
"targets": 1,
},
{
"render": function ( data, type, row ) {
// display badge based on http status
Expand Down
11 changes: 9 additions & 2 deletions web/static/custom/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,14 @@ function get_interesting_endpoints(project, target_id, scan_history_id) {
return "<a href='" + data + "' target='_blank' class='text-primary'>" + url + "</a>";
},
"targets": 0
}, {
},
{
"render": function(data, type, row) {
return htmlEncode(data);
},
"targets": 1
},
{
"render": function(data, type, row) {
// display badge based on http status
// green for http status 2XX, orange for 3XX and warning for everything else
Expand Down Expand Up @@ -1096,7 +1103,7 @@ function render_endpoint_in_xlmodal(endpoint_count, subdomain_name, result) {
<tr>
<td>${http_url_td}</td>
<td>${get_http_status_badge(endpoint['http_status'])}</td>
<td>${return_str_if_not_null(endpoint['page_title'])}</td>
<td>${return_str_if_not_null(htmlEncode(endpoint['page_title']))}</td>
<td>${parse_comma_values_into_span(endpoint['matched_gf_patterns'], "danger", outline=true)}</td>
<td>${return_str_if_not_null(endpoint['content_type'])}</td>
<td>${return_str_if_not_null(endpoint['content_length'])}</td>
Expand Down