W3C home > Mailing lists > Public > whatwg@whatwg.org > June 2010

[whatwg] idea about html code security anti xss

From: <gabmeyer@westweb.at>
Date: Wed, 16 Jun 2010 13:33:11 +0200
Message-ID: <8dd4239155a01f278c0e3c19873cdd4f@www.modtest.lan>
On 6/15/10 6:19 PM, gabmeyer at westweb.at 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 arun at mozilla.com wrote:    

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

https://wiki.mozilla.org/Security/CSP/Specification

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*
Received on Wednesday, 16 June 2010 04:33:11 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:24 UTC