Path traversal attack
A directory traversal, path traversal, or dot-dot-slash attack exploits insufficient security validation or sanitization of user-supplied file names, such that characters representing "traverse to parent directory" are passed through to the operating system's file system API.[src] An affected application can be exploited to gain unauthorized access to the file system.[src]
A directory traversal, path traversal, or dot-dot-slash attack exploits insufficient security validation or sanitization of user-supplied file names, such that characters representing "traverse to parent directory" are passed through to the operating system's file system API.[src] An affected application can be exploited to gain unauthorized access to the file system.[src] An attack against this system could be to send the following HTTP request: GET /vulnerable.php HTTP/1.0 Cookie: TEMPLATE=../../../../../../../../../etc/passwd The server would then generate a response such as: HTTP/1.0 200 OK Content-Type: text/html Server: Apache root:fi3sED95ibqR6:0:1:System Operator:/:/bin/ksh daemon:*:1:1::/tmp: phpguru:f8fk3j1OIf31.:182:100:Developer:/home/users/phpguru/:/bin/csh The repeated ../ characters after /home/users/phpguru/templates/ have caused include() to traverse to the root directory, and then include the Unix password file /etc/passwd .[src] Unix /etc/passwd is a common file used to demonstrate directory traversal, as it is often used by crackers to try cracking the passwords.[src] However, in more recent Unix systems, the /etc/passwd file does not contain the hashed passwords, and they are instead located in the /etc/shadow file, which cannot be read by unprivileged users on the machine.[src] Even in that case, though, reading /etc/passwd does still show a list of user accounts, which could then become a starting point for further attacks.[src] The user can use the NULL character (indicating the end of the string) in order to bypass everything after the $_GET .[src] (This is PHP-specific.)[src]
10 sentences · 10 cited inline · 0 references stored
References
No reference rows published for this article.
Cite this article
MLA
"Path traversal attack." encyclopegia.org, 2026, https://encyclopegia.org/wiki/path-traversal-attack. Accessed 27 November 2026.
Chicago
"Path traversal attack." encyclopegia.org. Accessed November 27, 2026. https://encyclopegia.org/wiki/path-traversal-attack.
APA
encyclopegia.org. (2026). Path traversal attack. Retrieved November 27, 2026, from https://encyclopegia.org/wiki/path-traversal-attack
Accessed November 27, 2026 · CC BY-SA 4.0 · citation page · JSON