Write Up File Path Traversal Traversal Sequences Stripped With Superfluous Url Decode
The application decoded user input twice and stripped traversal sequences only once, so a double-encoded traversal sequence survived the filter. An attacker could use this to read arbitrary files such as /etc/passwd.
Published on infosecwriteups.com
As you are reading this, I believe that you have already solved previous labs and know that this is the traversal sequence we have been using so far:
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the input was URL-decoded twice but the traversal filter ran only once, so a double-encoded sequence became a traversal sequence after filtering.
What the attacker needed
Access to the filename parameter
How it was found
- Send a double URL-encoded traversal sequence in the filename parameter.
- Observe that the server returns the contents of /etc/passwd in the response.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
Path traversal is when a user-supplied filename is used to reach files outside the intended folder, often by using '..' to go up directories. Here the app tried to block this by removing '..' sequences, but it also decoded the input twice, so a double-encoded '..' slipped through after the first decode and was not caught by the filter.
What is Path traversal?
Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.