Skip to main content

Practice ยท 2 of 3

HTML Encoder

Write encodeHTML(s) escaping exactly the five HTML-significant characters: & < > " '. Order matters โ€” & must be escaped first. Write rendersAsText(html) returning true when encodeHTML was applied to the payload (the encoded string contains "&lt;" and no raw "<").

Difficulty: intermediate

Back to lesson: Practice: XSS Sinks & Encoding โ€” Practice