Repaso
Español
SecurityIntermediateSEC-21

A request to /download?file=../../etc/passwd returns the system file. This is…

Options

  1. Path traversal (Correct option)
  2. SQL injection
  3. CSRF
  4. Race condition

Answer

Path traversal

Why

../ means 'go up one folder'. By chaining them, the attacker escapes the downloads folder and reads any file the server can access.

That is path traversal.

Fix: never use raw user input as a file path. Map IDs to files on the server, or resolve the final path and check it is still inside the allowed folder.

Remember

User input in file paths → path traversal risk.

Key terms

Practice this question in Repaso