Skip to content
Sharp

OWASP Vulnerabilities · interview question

Why is HTML encoding crucial in preventing stored XSS attacks?

Multiple choiceHardchapter-17-curatedpremiumowasp-vulnerabilitiessql-injection
Choose one answer
Answer and explanation

Correct answer

A. It ensures special characters are not executed as code

Why

HTML encoding converts special characters into their HTML entity equivalents, ensuring they are displayed as text rather than executed as scripts. This prevents malicious scripts from running in the user's browser.

Test yourself on OWASP Vulnerabilities

A free test with instant, explained results. No account needed.

Start free test
All OWASP Vulnerabilities questions →