Interview practice question
Stored XSS found in user profiles
Backend Engineering · Auth and Security · Experienced
A researcher reports that HTML in user profile bios executes scripts for anyone viewing the profile. How do you fix it fully?
What a strong answer covers
Your AI report card counts how many of these ideas you cover.
- Escape output by context / safe templating.
- Sanitise allowed rich text with allowlist library.
- Clean existing stored data.
- Add strict Content Security Policy.
- Rotate sessions if exploited; add tests.
Practise this topic
Start without signing up. Sign in free to get an AI report card on your answer.