MediumScenarioAppSec and OWASP scenarios
A search page reflects input into HTML and an attacker steals session cookies. Describe the defences.
What a good answer covers
Context-aware output encoding, a strict Content-Security-Policy, HttpOnly and SameSite cookies, input validation, and modern frameworks' auto-escaping while avoiding innerHTML.
PreviousA pen test finds that changing /api/orders/123 to /124 shows another user's order. What is it and how do you fix it?Next Your API accepts a URL to fetch images and an attacker reaches the cloud metadata endpoint. What is the attack and mitigation?
More on AppSec and OWASP scenarios
Flashcards for this topic- MediumA pen test finds that changing /api/orders/123 to /124 shows another user's order. What is it and how do you fix it?
- HardYour API accepts a URL to fetch images and an attacker reaches the cloud metadata endpoint. What is the attack and mitigation?
- MediumHow does parameterised querying prevent SQL injection?
- MediumA JWT-protected API accepts tokens with alg none. What went wrong?