I have an application where users can upload a file for us to perform some actions. The only expected filetype is JSON, and initially we restricted the uploads to be of type application/json
.
However, we have one user who, when they try to upload JSON files gets errors. We can update the application to allow files of type application/octet-stream
and get things working, but this seems semantically.
I don't know much about application/octet-stream
. In my searches I haven't learned much more. It seems that some browsers may convert files to this type when they don't know what to do with it; sometimes this error can be thrown when a file extension is not present (we have tested it with and without and still get the same issue); and it seems like this type allows files of type .exe
and whatever else to be uploaded.
Are there security risks if we allow users to upload files of type application/octet-stream
? Why or why not?