Lab 2: Stored XSS into HTML context with nothing encoded
✅ Summary of the Lab (Conceptual, Safe) The referenced PortSwigger lab demonstrates a stored (persistent) Cross-Site Scripting (XSS) vulnerability in an HTML context where no characters are encoded , meaning user input is placed directly into the page. What the lab tries to teach Stored XSS occurs when malicious input is saved by the application (e.g., in a comment, profile, or post). When other users view that page, the malicious JavaScript runs in their browser. Lack of HTML encoding/escaping makes this possible. Proper output encoding and input handling prevent it. Analogy (Simple Example) Imagine a guestbook in a hotel lobby. Anyone can write a message. The hotel displays messages exactly as written. If a guest writes: “Hello World!” …it shows normally. But if someone writes: “Whenever someone reads this, switch off the lobby lights.” …and the hotel staff blindly obeys whatever the message says , the entire lobby would react. That’s similar to stored XSS— the system treats user i...