Intraplanar.net - Web design http://intraplanar.net/taxonomy/term/11/0 en CSS input opacity exploit http://intraplanar.net/2004/09/css-input-opacity-exploit-0 <p>Peter-Paul Koch recently published an <a href="http://www.quirksmode.org/dom/inputfile.html">article</a> on <a href="http://www.quirksmode.org/">Quirksmode.org</a> explaining how to use the CSS3 "opacity" style (or equivalent proprietary opacity styles) to change the appearance of file input form fields. While the technique presented in the article might appeal to designers, it also demonstrates a security vulnerability which apparently exists in most modern browsers and which should be fixed.</p> <p>The article explains how the text box and browse button elements of a <span style="font-family:monospace;white-space:nowrap;">&lt;input type="file"&gt;</span> form element can be replaced with similar graphics. The problem is that a malicious webpage could easily replace the input with a different kind of graphic, one which could deceive the user into unknowingly uploading a file.</p> <p>A simple example of an exploit of this feature would be to make the input element seem to be a simple text box. <a href="/files/fileopacityexploit.html">This page</a> demonstrates this method. The input element is made transparent and a text box graphic is used as a background image giving the appearance that the form field is a simple text box. The text presented asks the user to type in the path to a sensitive file, which will be uploaded when the user clicks the "Next" button.</p> <p>I believe that this exploit demonstrates why file input elements need to be treated special, and that granting the ability to "style" them needs to be very carefully considered to eliminate possibilities like this. The second proposal given <a href="http://bugzilla.mozilla.org/attachment.cgi?id=17860&action=view">here</a> (essentially, prompting the user to confirm a list of files to be uploaded prior to performing the upload) is one possible way to work around this type of situation. However, I would still recommend disallowing the opacity style to be applied to file input elements.</p> <p>I have submitted a bug to mozilla.org for this issue (I can't link to it since it is currently restricted because it is a security issue, though not a very secret one anymore) but hopefully the other browser manufacturers will come to the same conclusion that I have.</p> http://intraplanar.net/2004/09/css-input-opacity-exploit-0#comments Web design http://intraplanar.net/comments/node/26/feed Mon, 13 Sep 2004 20:28:50 -0500 tangent 26 at http://intraplanar.net