Skip to content

Commit

Permalink
fix(security): Incomplete string escaping or encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
adrienjoly committed Aug 20, 2023
1 parent 3d68315 commit c1e21c3
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions public/js/whyd.js
@@ -1,4 +1,4 @@
/* global $, openRemoteDialog, whydPlayer, goToPage, showMessage, openJqueryDialog, htmlEntities, avgrundClose, QuickSearch */
/* global $, _, openRemoteDialog, whydPlayer, goToPage, showMessage, openJqueryDialog, htmlEntities, avgrundClose, QuickSearch */

const MAX_NB_MENTIONS = 6;

Expand Down Expand Up @@ -1193,10 +1193,9 @@ $(document).ready(function () {
// Update the title
document.title = $data.find('.document-title:first').text();
try {
document.getElementsByTagName('title')[0].innerHTML = document.title
.replace('<', '&lt;')
.replace('>', '&gt;')
.replace(' & ', ' &amp; ');
document.getElementsByTagName('title')[0].innerHTML = _.escape(
document.title,
); // use underscore.js to encode html entities
} catch (err) {
console.error(err);
}
Expand Down

0 comments on commit c1e21c3

Please sign in to comment.