Python

Python : Unsafe file upload

Classification

OWASP Top 10 2013
OWASP Top 10 2017
OWASP Top 10 2021
PCI DSS 4.0

Overview

If users can upload files to publicly accessible directories, an attacker can use it for remote execution of malicious code on the server.

MEDIA_ROOT specifies the absolute filesystem path to the directory that will hold files uploaded by user. STATIC_ROOT specifies the absolute path to the directory where collectstatic will collect static files for deployment. MEDIA_ROOT and STATIC_ROOT must have different values.

MEDIA_URL stores the URL used to manage the stored files. MEDIA_URL and STATIC_URL must also have different values.

LOW

DerScanner Severity Score

Check your Python code for this vulnerability, free

Request a free pilot of DerScanner. We give you access and help with the first scan. It works in the cloud and on-premise.

Try it on your code, free

By submitting this form, I acknowledge that DerScanner may process my personal data I provided above for purposes explained above. More details about the processing.