Skip to content

Restrict UserDocument uploads to pdf and image extensions - #2496

Open
Threeguana wants to merge 1 commit into
wger-project:masterfrom
Threeguana:security/userdocument-file-validator
Open

Restrict UserDocument uploads to pdf and image extensions#2496
Threeguana wants to merge 1 commit into
wger-project:masterfrom
Threeguana:security/userdocument-file-validator

Conversation

@Threeguana

Copy link
Copy Markdown

adds a validator to the userdoc model field to prevent arbitrary file uploads (such as executables or scripts).

changes:
restricted allowed extensions on userdoc to pdf,jpg,jpeg,png.
Added unit tests (UserDocumentFileValidationTest) to verify valid and invalid file extensions against the model's fullclean.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

2 participants