wathne / dat250-2024-assignment

MIT License
0 stars 0 forks source link

Unrestricted File Upload #10

Closed LisaCabot closed 3 days ago

LisaCabot commented 1 week ago

Description: The application does not validate uploaded file path, name, size or content. Potential Impact: Upload malicious code or config files to be executed by the server. Overwrite files. Affected part of the application: ./social_insecurity/routes.py Type of vulnerability: Unrestricted Upload of File with Dangerous Type (https://cwe.mitre.org/data/definitions/434.html)

wathne commented 3 days ago

Fixed by LisaCabot https://github.com/wathne/dat250-2024-assignment/commit/c0165cdd30cdcec6c92bc9846d8a436808158236

Refactored by wathne https://github.com/wathne/dat250-2024-assignment/commit/408ad51d7ee3a0066749537857f1fac8bda6eaa2

wathne commented 3 days ago

Reopened this issue. We should sanitize "post_form.image.data.filename", in routes.py, with the werkzeug.utils.secure_filename(filename) function.

wathne commented 3 days ago

Amended by wathne https://github.com/wathne/dat250-2024-assignment/commit/797c36b11d7880348c5f1ae6050c8e794489c343