When web app validates the type only on the front-end, we can easily bypass by intercepting and modifying the traffic using Burp Suite.
Most web apps will have type validation control on the back-end server but this can still be bypassed.
Blacklisting Extensions
Let’s say we get Extension not allowed
error when uploading .php
file.
There are generally two common forms of validating a file extension on the back-end:
- Testing against a
blacklist
of types - Testing against a
whitelist
of types
e.g Code below checks if the uploaded file extension is PHP
Fuzzing Extensions
We should fuzz extensions to find out which of them passes the filter.
We can use SecLists’s Web Extensions along with Burp Suite to do this.