Jump to content
TheTime

IE and text/plain

Recommended Posts

Posted

Salutare baieti,

Zilele trecute am descoperit o chestie interesanta in Internet Explorer: atunci cand are activat compatibility view, interpreteaza orice fisier text (mime type text/plain) ca fiind html (text/html).

Exemplu aici.

Exemplul de mai sus este livrat de server cu content type text/plain si este interpretat de Chrome, Firefox, IE ca fisier text, dar IE + compatibility view il vede ca html. Nu e greu de reprodus, deschideti link-ul in IE, apasati F12 si schimbati ceva la Browser mode sau Document mode. Am testat in IE9 si IE10.

Ce am zis mai sus nu e vreun secret, am gasit un articol pe msdn in care cei de la microsoft prezinta aceasta problema ca fiind un "feature" util dezvoltatorilor.

Citat din articolul de mai sus:

It's also a welcome change from a security point of view

... m-au lasat fara cuvinte, mi se pare aberant. Sunt o gramada de site-uri ce te lasa sa uploadezi fisiere text pe site-urile lor dupa ratiunea "pana la urma cat rau poate face un fisier text pe un server?!?" si sunt destule companii care isi forteaza angajatii prin Group Policy sa foloseasca IE cu compatibility view activat pentru a putea folosi site-urile lor interne dezvoltate pe vremea lui IE6. Pentru acesti angajati, un fisier text uploadat pe un server se poate transforma intr-o suita de vulnerabilitati client side intrucat pentru ei acel document text va fi interpretat ca html si codul javascript de acolo va fi executat ca pe orice pagina normala.

Aviz vanatorilor de recompense, daca gasiti vreun upload form ce va permite sa incarcati fisiere text pe server si va dau link catre acele fisiere, puteti sa va construiti un argument cum ca aceasta ar fi o problema de securitate.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...