Is Django framework vulnerable to local file inclusion(LFI) and remote file inclusion(RFI)?

1.9k Views Asked by At

Like in php, include() method and allow_url_include can be vulnerable to LFI and RFI.

Does django's include is vulnerable to lfi and RFI?

1

There are 1 best solutions below

4
On

Not unless you mess with the default template loaders. Django doesn't let you include files located outside of the application's templates folders and does its best to prevent you from touching external files using built-in operations.

As a general rule of thumb, it doesn't hurt to keep your application code completely isolated from the path where a user can upload files and to sanitize and reduce user-provided input's interactions with potentially dangerous functions.