Created
January 29, 2021 16:10
-
-
Save LIQRGV/374b880012d1d84b8703d6339d44f78b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script src="https://code.jquery.com/jquery-1.11.1.min.js"></script> | |
</head> | |
<body> | |
<div id="target"></div> | |
<script> | |
const malPayload = "<script>alert('1337')<\/script>"; | |
// current code | |
//const childNode = "<div>Payload: " + malPayload + "<\/div>"; | |
//$('#target').html(childNode); | |
//proposed code | |
const childNode = document.createElement('div'); | |
childNode.innerText = "<div>Payload: " + malPayload + "<\/div>"; | |
document.querySelector('#target').appendChild(childNode); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment