Back to Introduction
Medium Risk
Wiki Entry
Missing X-Content-Type-Options Header
The X-Content-Type-Options header is not set. This header prevents browsers from guessing the content type of files.
Why This Matters
Without this header, browsers might interpret files in unintended ways. For example, a text file could be executed as JavaScript, allowing attackers to run malicious code if they can upload files to your server.
How to Fix
Framework-specific solutions and general best practices
Add the header 'X-Content-Type-Options: nosniff' to all responses. This tells browsers to strictly follow the Content-Type you specify.
Quick Reference
Severity
Medium Risk
ID
missing_x_content_type_optionsAI Assistant Prompt
Copy this prompt to ask an AI for help fixing this vulnerability:
Please fix the "Missing X-Content-Type-Options Header" security vulnerability in this web application. The issue is: The X-Content-Type-Options header is not set. This header prevents browsers from guessing the content type of files. Make a plan and implement based on my project.