Path Traversal Explained: How It Works and How to Prevent It
Path traversal (also called directory traversal, CWE-22) happens when an application builds a file path from user input without making sure the result stays inside the intended folder. Input such as../../etc/passwd or an absolute path makes the server read, or sometimes write, files elsewhere, exposing configuration files, source code and credentials.