I planned on using this inconsistency in my next bypass, but I have so much other stuff to take care of.
0[{}/'regex and string'/+0]
When verifying the object accessor you are verifying an expression, but the way you verify it interpret it as a statement. In the above statement, the verification sees "a block, a regex plus zero" where as JSReg sees "an object divided by a string divided by positive zero". We can test this inconsistency with the following two statement:
0[{}/+0/+0] -> "Incorrect object accessor" due to incorrect regex /+0/ with invalid quantifier
0[{}/0+/+0] -> "Unterminated regex" due to 0+/+0]
This should be possible to exploit along the lines of:
1. alert(window[{}/.../+0])
2. replace ... with valid regex, that puts JSReg in an inconsistent state, such as [x+++{}/'/i//'...]
3. replace ... with malformed syntax that breaks J.P(...), such as ),('location'
I'm not saying that this is a working exploit, just along those lines. The fix would be quite simple;
if(!isValidSyntax('(' + code.slice(beginSquarePos, pos-1) + ')')) {
error("Syntax error: Invalid object accessor");
}
----------------34----------------
_=/.+?('['_='+_(_)]+).+/,'_='+_(_)
Edited 2 time(s). Last edit at 08/24/2011 01:19PM by Jonas Magazinius.