How to handle mime types, file extension and magic number on file upload, renaming and file download?

I am writing a simple server for file uploading. I want to be able to rename uploaded files (including the file extension) and download files.
For validating the file to upload my plan was to check if the mime type, the file extension and … Continue reading How to handle mime types, file extension and magic number on file upload, renaming and file download?

Is mime-sniffing still something to protect against with modern browsers (with X-Content-Type-Options)?

I have read about X-Content-Type-Options and it says often that it protects against IE mime sniffing problems.
I am wondering if in 2021 it is still valid and a problem for modern browsers? In other words, will it be beneficial for my web … Continue reading Is mime-sniffing still something to protect against with modern browsers (with X-Content-Type-Options)?

How to intercept application specific MIME types used by 3rd party (Windows) browser/plugins apps?

I’m trying to intercept and decipher scripted code that is sent to a previously installed Windows application, after a user have clicked on a particular URL in their web browser which is somehow returning a MIME response that is intercepte… Continue reading How to intercept application specific MIME types used by 3rd party (Windows) browser/plugins apps?

How could a software reliably tell if an URL makes me download a file and what its filename and mimetype are? (without downloading the file) [migrated]

In order to write an application for myself that prevents me from visiting websites that let me download files of a certain type, I am trying to find a way to reliably tell if an URL lets me download a file and if so then tell me the filen… Continue reading How could a software reliably tell if an URL makes me download a file and what its filename and mimetype are? (without downloading the file) [migrated]

Is it necessarily Content spoofing if the content type of the response does not match the content type of the request?

The security team of my company is stating that content spoofing occurs when they send a different “content-type” for an HTTP request that only accepts JSON content type, and the server response is an error HTML page, natural… Continue reading Is it necessarily Content spoofing if the content type of the response does not match the content type of the request?