- Home
- All questions
- Question 149
CompTIA Security+ study material · question 149 of 611
Why does a single encoding function not prevent all cross-site scripting?
Show the answer
Answer: B. Because HTML body, attribute, JavaScript and URL contexts each need different encoding
The safe transformation depends on where the data lands, so context-appropriate encoding is what is required.
Source: OWASP Cross Site Scripting Prevention Cheat Sheet (OWASP) — OWASP Cross Site Scripting Prevention Cheat Sheet › Output Encoding