← Quiz: XSS: all 10 questions
Quiz: XSS · Question 9 of 10
A course description must allow bold text and links from instructors. What is the safe approach?
A course description must allow bold text and links from instructors. What is the safe approach?
- A.Turn off escaping for that field
- B.Sanitise the HTML with an allow-list of tags and attributes using a trusted library
- C.Remove the word "script" from the text
- D.Store it in a cookie
Answer & explanation
Correct answer: Sanitise the HTML with an allow-list of tags and attributes using a trusted library
Allow only known-safe tags such as b, i and a with a checked href.
Can you get the rest right without peeking?
Take the timed Quiz: XSS quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →