File lookup can escape its allowed directory
- Context
- A download endpoint accepts a file path from a request parameter.
- Verification
- In a test fixture, check whether a request can read a file outside the downloads folder.
- Proposed fix
- Resolve the file’s real path, including symlinks, and reject paths outside the allowed directory.
What would you test before approval?
- A valid file inside the allowed directory still downloads.
- Traversal paths and symlinks pointing outside the directory are rejected.


