Read more

Security considerations in MIME-Type configuration

Kim Klotz
July 19, 2023Software engineer at makandra GmbH

When you are using the default MIME-Type configuration and your application allows uploading files, it can be a security issue.

Example:

Illustration web development

Do you need DevOps-experts?

Your development team has a full backlog? No time for infrastructure architecture? Our DevOps team is ready to support you!

  • We build reliable cloud solutions with Infrastructure as code
  • We are experts in security, Linux and databases
  • We support your dev team to perform
Read more Show archive.org snapshot

A user uploads a file with HTML/JavaScript content using no file extension.

In the Apache default configuration if you access the file it will have no Content-Type. Some browsers will guess/autodetect it as HTML and now you are vulnerable to XSS.

To prevent this, you can set a default Content-Type (e.g. plain/text or application/octet-stream).

Posted by Kim Klotz to makandra Operations (2023-07-19 08:35)