Four different ways access control can fail. Each tab below isolates one CWE so you can focus on it. All four share the same root cause: the server trusts a user-supplied value to decide what data to return.
The app reads files inside /tmp/demo/userfiles. It builds the full path
with os.path.join and opens it — without checking the result stayed
inside that directory.
path = os.path.join(USER_DIR, filename) return open(path).read()
Submit note1.txt. Normal behaviour.
Submit ../fakepasswd. The .. escapes USER_DIR.