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

Add python-magic for validating mimetypes #3061

Merged
merged 2 commits into from
Jun 29, 2024

Conversation

yunimoo
Copy link
Contributor

@yunimoo yunimoo commented May 31, 2024

Potential solution for #3044

This PR adds in mimetype checking to ensure that files being uploaded are not maliciously disguised.

Create a bash script:

# test.sh
#!/bin/bash
echo "Hello World!"

Rename the bash script: (Ensure that server allows epub)

mv test.sh test.epub

Upload the file to confirm that it is not possible as the mimetype is read differently.

Screen Shot 2024-05-31 at 5 52 26 PM Screen Shot 2024-05-31 at 5 58 14 PM Screen Shot 2024-05-31 at 5 53 42 PM

@yunimoo yunimoo force-pushed the python_magic_poc branch from 9a5b780 to 18a174d Compare May 31, 2024 22:07
@yunimoo yunimoo force-pushed the python_magic_poc branch from 18a174d to af52748 Compare May 31, 2024 22:08
@yunimoo yunimoo changed the title Python magic poc Add python-magic for validating mimetypes May 31, 2024
@OzzieIsaacs OzzieIsaacs merged commit d5a57e3 into janeczku:Develop Jun 29, 2024
@yunimoo yunimoo deleted the python_magic_poc branch July 7, 2024 00:03
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