Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve security for file upload #47

Merged
merged 9 commits into from
Jan 18, 2024
Merged

improve security for file upload #47

merged 9 commits into from
Jan 18, 2024

Conversation

GeorgeGoodall
Copy link
Contributor

@GeorgeGoodall GeorgeGoodall commented Jan 17, 2024

Ticket: https://trello.com/c/v5JRhYVn/1177-ensure-safe-upload-of-files

This ticket improves the security checks for the file that is uploaded

it does this by adding checks for validating

  • the extension
  • the size
  • the filename

It also ensures files are deleted after the have been processed

return true
}

static fileMimeTypeMatchesExtension (datafile) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make this check cover both the is valid extension and is valid mime type ones? (although we still need to check there is exactly only one extension)

@GeorgeGoodall GeorgeGoodall merged commit a0beb23 into main Jan 18, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants