<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.26.3">
</HEAD>
<BODY>
On Wed, 2010-06-16 at 13:33 +0200, gabmeyer@westweb.at wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
On 6/15/10 6:19 PM, <A HREF="mailto:gabmeyer@westweb.at">gabmeyer@westweb.at</A> wrote:
 Hello,

 I had just this idea after reading so much about xss and code injection.

 I think there is a simple solution:

 1.)
 I now invent an attribute called strlen=""

 I append this to ahtmlcode with strlen of 94843 bytes including whitespace

 The browser know knows the exact position where the divtag must end.

 You cannot inject some code that closes the tag before.

 2.)
 you can now control the code inside the div.
 you can also append a second attribute called "secure" that prevents any scriptcode to run from inside the div.


 Maybe this idea is not new, or does not work.

 Please let me know what you think about this idea.

 Christian Gabmeyer

On 2010-06-16 03:29:50 <A HREF="mailto:arun@mozilla.com">arun@mozilla.com</A> wrote:    

I think one approach that we're interested in pursuing at Mozilla is the 
Content Security Policy approach:

<A HREF="https://wiki.mozilla.org/Security/CSP/Specification">https://wiki.mozilla.org/Security/CSP/Specification</A>

In particular, restrictions on inline scripts, or at least on 'eval' 
might be useful here, along with other mitigation on loading cross-site 
content.

We'd like this in the Firefox 4 timeframe.

-- A*


Hello Arun
CSP: This seams to affect only the whole document, because it uses a header to switch browser into secure mode. but from a htmlcoder  point this is not the place where i work. everybody should be able to write secure code not only the developer, i think.

my aproach to be able to define a strlen attribute gives the browser the ability to check for broken/closing tags, and in case of an injection inside the string it must ignore the foreign closing tag .
If i put all unsecure code into sections of <div unsecure="strlen in bytes"></div> it is posible for the browser to render the page correctly and than apply CSP to it.
on the server side the developer must not know the content or even inspect it the only thing todo is run strlen() around it and create the tag surrounding the content.

-- C*



</PRE>
</BLOCKQUOTE>
<BR>
You're still missing the fact that the way most attacks happen is because the user-entered data is accepted by the server, and then output by the server. From where is it expected to make a correct strlen() calculation?! XSS attacks aren't just loads of code entered at the client-side of things. It's an attack on a system to exploit the browser, but at the end of the day, the onus is on the server to resolve the issue, as the browser isn't going to always make the best judgement call to fail something gracefully.<BR>
<BR>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
Thanks,<BR>
Ash<BR>
<A HREF="http://www.ashleysheridan.co.uk">http://www.ashleysheridan.co.uk</A><BR>
<BR>
<BR>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>