Path Traversal
Talk it through out loud with your AI coach.
The problem
- medium
- Pro
Your app has a download endpoint that takes a file name and returns that file from an uploads folder. Explain how an attacker could use it to read files outside that folder, and how you'd make it safe.
What a strong answer covers
- How a crafted file name escapes the intended folder.
- Why filtering out bad characters is easy to get round.
- A reliable way to make sure only intended files are served.
- Extra layers that limit the damage if a check is missed.
Common mistake: Stripping out dot-dot sequences once and assuming the input is now safe.
Knowing this is half of it. Saying it clearly out loud is the part the coach helps you practise.
Practise it out loud