Skip to content

Conversation

ghost
Copy link

@ghost ghost 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

@ghost ghost 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
@ghost ghost 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.

1 participant