MIME Type Syntax Checker
Identify valid MIME types and media extensions to ensure upload rules reject dangerous formats.
How It Works
- Enter a file extension (e.g. .json, .pdf, .wasm) or MIME content-type string (e.g. application/json).
- The tool searches the IANA Media Types registry database.
- Matches output official MIME types, associated extensions, encoding standards, and security implications.
Primary Use Cases
- Configuring web server Content-Type headers (Nginx, Apache, Caddy) to prevent MIME-confusion vulnerabilities.
- Auditing file upload handlers to ensure uploaded file extensions match validated MIME types.
- Troubleshooting browser rendering issues caused by incorrect content-type headers.
Common Security Pitfalls
- Trusting the client-submitted Content-Type header on file uploads (attackers can easily send text/plain while uploading executable PHP or shell scripts).
- Failing to send the X-Content-Type-Options: nosniff header, allowing browsers to MIME-sniff and execute untrusted files.
Frequently Asked Questions
- What is MIME type sniffing?
- MIME sniffing is when a browser ignores the declared Content-Type header and inspects the file body bytes, which can lead to XSS attacks if user-uploaded images contain HTML/JS.
- How do you prevent MIME sniffing attacks?
- Serve the HTTP response header 'X-Content-Type-Options: nosniff' on all responses.
References & Standards