Skip to content
Sharp

OWASP Vulnerabilities · interview question

Why would you choose to use HTML encoding in Java web applications?

Multiple choiceMediumchapter-17-curatedpremiumowasp-vulnerabilitiescross-site-scripting-xss
Choose one answer
Answer and explanation

Correct answer

C. To prevent execution of malicious scripts

Why

HTML encoding converts characters that could be interpreted as code into a safe format, preventing malicious scripts from executing in the browser.

Test yourself on OWASP Vulnerabilities

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

Start free test
All OWASP Vulnerabilities questions →