Skip to content

Commit

Permalink
Fix XSS in result display
Browse files Browse the repository at this point in the history
  • Loading branch information
smalyshev authored and lucaswerkmeister committed Jul 16, 2019
1 parent 3127706 commit 881d055
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bigdata-war-html/src/main/webapp/html/js/workbench.js
Original file line number Diff line number Diff line change
Expand Up @@ -1628,9 +1628,12 @@ function showPage(n) {
linkText = escapeHTML(text).replace(/\n/g, '<br>');
if(binding.type == 'typed-literal') {
tdData = ' class="literal" data-datatype="' + binding.datatype + '"';
text = linkText;
} else {
if(binding.type == 'uri' || binding.type == 'sid') {
text = '<a href="' + buildExploreHash(text) + '">' + linkText + '</a>';
} else {
text = linkText;
}
tdData = ' class="' + binding.type + '"';
if(binding['xml:lang']) {
Expand Down Expand Up @@ -1693,7 +1696,7 @@ function exploreSubmit(e) {
}

function buildExploreHash(uri) {
return '#explore:' + NAMESPACE + ':' + uri;
return '#explore:' + NAMESPACE + ':' + encodeURIComponent(uri);
}

function loadURI(target) {
Expand Down

0 comments on commit 881d055

Please sign in to comment.