Skip to content

Commit

Permalink
Merge pull request #337 from ArtemBernatskyy/patch-1
Browse files Browse the repository at this point in the history
Fixed security issue in demo (Reverse Tabnabbing)
  • Loading branch information
cure53 authored May 15, 2019
2 parents f4c22d6 + e7b3376 commit 7601c33
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions demos/hooks-target-blank-demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
// set all elements owning target to target=_blank
if ('target' in node) {
node.setAttribute('target','_blank');
// prevent https://www.owasp.org/index.php/Reverse_Tabnabbing
node.setAttribute('rel', 'noopener noreferrer');
}
// set non-HTML/MathML links to xlink:show=new
if (!node.hasAttribute('target')
Expand Down

0 comments on commit 7601c33

Please # to comment.