> For the complete documentation index, see [llms.txt](https://kunalwalavalkar.gitbook.io/write-ups/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kunalwalavalkar.gitbook.io/write-ups/portswigger-labs/server-side-topics/path-traversal/file-path-traversal-validation-of-start-of-path.md).

# File path traversal, validation of start of path

<figure><img src="/files/CRYe08EXIpXdRFeQfbg2" alt=""><figcaption></figcaption></figure>

Let's access the image through the browser.

<figure><img src="/files/vCiQMTHN4BZS6O6C4EnC" alt=""><figcaption></figcaption></figure>

We can now intercept this request in Burp Suite using the `Proxy`.

<figure><img src="/files/a6DsGVEFOg7sAL7LOEF8" alt=""><figcaption></figcaption></figure>

Now, we can forward the request to the `Repeater` to makes changes in it.

Let's change the `filename` parameter to the following and forward the request:

```
/etc/passwd
```

<figure><img src="/files/upaiZFEO6ByXHZHWNIzV" alt=""><figcaption></figcaption></figure>

The server requires the user-supplied filename to start with `/var/www/images`.

```
/var/www/images/../../../etc/passwd
```

<figure><img src="/files/tJGIwpG1sNics0YjoIex" alt=""><figcaption></figcaption></figure>

We have successfully solved the lab.

<figure><img src="/files/eyTAsMRHXRXd8hTl5uSK" alt=""><figcaption></figcaption></figure>
