← Quiz: Command Injection and Path Traversal: all 10 questions
Quiz: Command Injection and Path Traversal · Question 9 of 10
What is the strongest design for letting students download their own offer letters?
What is the strongest design for letting students download their own offer letters?
- A.Accept any file name but hide the download link
- B.Block file names longer than 20 characters
- C.Store files under random ids, look up the path in the database and check the owner
- D.Put all files in the website's public folder
Answer & explanation
Correct answer: Store files under random ids, look up the path in the database and check the owner
The user never controls a path, and the ownership check also prevents IDOR.
Can you get the rest right without peeking?
Take the timed Quiz: Command Injection and Path Traversal quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →