Preamble
Thus, IE makes a sniff of the Mime type . This piece of old news.
Suggestions on how to deal with it, as a rule, are related to "supplying IE proxies of the type of content" (i.e. nothing that is text / regular or application / octet-stream) or "add extraneous data at the beginning of the file, which definitely refers to the type you serve. "
Now I'm working on an application that should allow message attachments (for example, in email messages), sometimes appear in a string (again, like in email messages), and we want to close the XSS vectors. IE mime sniffing (in unpatched IE6-, which I have to support, for example IE6 / Win2000), is one of these vectors - a text/plain file with html content will run as html. Recoding is not an option at the moment, changing attachments that the user has provided can only happen if there is absolutely no doubt about the file’s maliciousness - and someone might want to send HTML as text.
Now the Microsoft MSDN article implies that the situation may be easier to fix than advertised:
If Internet Explorer knows the Content Type and there is no Content-Disposition Data , Internet Explorer performs a "MIME sniff", [...]
Excellent!
Except that I don’t have IE and I don’t have the current tools to install it securely (I understand that this is a rather sad state for a web developer, I hope to fix it soon), and this is a gray theory that I cannot quite seems to be confirmed one way or another. Local sources say that the line is hogwash - IE will mime sniff everything that is Content-Disposition: inline / <default> and is not specific enough for its tastes in -Type .
But what about x- * ( 'extension-token' in RFC )?
Google’s attempt to understand how the browser handles Content-Disposition: <extension-token> has yielded nothing (although maybe I’m just mistaken, my understanding of Google has been seriously slipping away recently). I found one question that looked promising, but turned out to be a misunderstanding on the side of the thread author, which meant that the train of thought was never really there.
Question (s)
Does IE Mime really smell when you explicitly pass Content-Disposition: inline ?
If yes: does anyone know how the browser handles Content-Disposition: <extension-token> ?
If they do it in a way that is benign for my purposes, assuming that it is a default synonym (effectively "inline", although I heard that it is not defined anywhere?), Is it enough for IE not to sniff Mime ? Or am I really shooting myself in the foot, thinking about chasing this path?