Web Security · Middle · Question 2 of 75
Which of these is a DOM XSS sink?
- ✓Correct answer:
element.insertAdjacentHTML() - 2
element.textContent = value - 3
element.setAttribute('class', value)
Explanation
Sinks parse strings as HTML or code: innerHTML, outerHTML, insertAdjacentHTML, document.write, eval, setTimeout(string) and URL properties that accept javascript:.