Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2482)

Issue 283510043: Fix and backstop bugs in finding identifier names. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
8 years, 1 month ago by MarkM
Modified:
8 years ago
Reviewers:
kpreid_google
CC:
Jasvir, MarkM, ihab.awad, MikeSamuel, kpreid2, metaweta, felix8a, caja-discuss-undisclosed_googlegroups.com, karshan
Visibility:
Public.

Description

Committed as 739a368f287d119c263428367df1dffd98906d0f . ES6 extended the syntax of identifiers to include the unicode escape sequence backslash-u-opencurly-hexdigits-closecurly. This meant that untrusted code could name global variables that we would not notice as a single token, and thus would not censor. Since this regexp-based recognition of possible variable name mentions seems fragile, we added an additional backstop mechanism: we sample the set of global variable names and build a backstop object with a poisoned accessor for each of these names. Each actual scopeObject then inherits from this accessor. Thus, if atLeastFreeVarNames missed a name, but that was the name of a global variable when the backstop was built, then the poisoned accessor on the backstop will intercept it instead. We add a new ses.resampleGlobal() to the privileged api, so our client can advise when they've added additional global variables, so we can resample. This change builds on https://codereview.appspot.com/285330043/ , which should be considered our diffbase.

Patch Set 1 #

Total comments: 14

Patch Set 2 : Fix and backstop bugs in finding identifier names. #

Total comments: 1

Patch Set 3 : Fix and backstop bugs in finding identifier names. #

Total comments: 2

Patch Set 4 : Fix and backstop bugs in finding identifier names. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+252 lines, -20 lines) Patch
M src/com/google/caja/plugin/ses-frame-group.js View 1 1 chunk +4 lines, -0 lines 0 comments Download
M src/com/google/caja/ses/atLeastFreeVarNames.js View 1 2 4 chunks +48 lines, -10 lines 0 comments Download
M src/com/google/caja/ses/compileExprLater.js View 1 2 chunks +8 lines, -5 lines 0 comments Download
M src/com/google/caja/ses/explicit.html View 1 chunk +1 line, -0 lines 0 comments Download
M src/com/google/caja/ses/startSES.js View 1 4 chunks +70 lines, -5 lines 0 comments Download
M tests/com/google/caja/ses/test-ses-parts.js View 1 2 3 2 chunks +121 lines, -0 lines 0 comments Download

Messages

Total messages: 11
MarkM
8 years, 1 month ago (2016-03-05 05:48:37 UTC) #1
MarkM
Aside from carrying forward the tests from our diffbase, snapshot 1 adds no tests. Since ...
8 years, 1 month ago (2016-03-05 06:04:03 UTC) #2
MarkM
https://codereview.appspot.com/283510043/diff/1/src/com/google/caja/ses/startSES.js File src/com/google/caja/ses/startSES.js (right): https://codereview.appspot.com/283510043/diff/1/src/com/google/caja/ses/startSES.js#newcode571 src/com/google/caja/ses/startSES.js:571: ses.resampleGlobal = resampleGlobal; On 2016/03/05 06:04:03, MarkM wrote: > ...
8 years, 1 month ago (2016-03-05 06:08:00 UTC) #3
kpreid_google
https://codereview.appspot.com/283510043/diff/1/src/com/google/caja/ses/atLeastFreeVarNames.js File src/com/google/caja/ses/atLeastFreeVarNames.js (right): https://codereview.appspot.com/283510043/diff/1/src/com/google/caja/ses/atLeastFreeVarNames.js#newcode176 src/com/google/caja/ses/atLeastFreeVarNames.js:176: // JSON.parse will reject with an error. This sentence ...
8 years, 1 month ago (2016-03-07 22:18:49 UTC) #4
MarkM
ES6 extended the syntax of identifiers to include the unicode escape sequence backslash-u-opencurly-hexdigits-closecurly. This meant ...
8 years, 1 month ago (2016-03-08 03:52:11 UTC) #5
MarkM
https://codereview.appspot.com/283510043/diff/1/src/com/google/caja/ses/atLeastFreeVarNames.js File src/com/google/caja/ses/atLeastFreeVarNames.js (right): https://codereview.appspot.com/283510043/diff/1/src/com/google/caja/ses/atLeastFreeVarNames.js#newcode176 src/com/google/caja/ses/atLeastFreeVarNames.js:176: // JSON.parse will reject with an error. On 2016/03/07 ...
8 years, 1 month ago (2016-03-08 03:55:11 UTC) #6
MarkM
ES6 extended the syntax of identifiers to include the unicode escape sequence backslash-u-opencurly-hexdigits-closecurly. This meant ...
8 years, 1 month ago (2016-03-08 12:02:21 UTC) #7
kpreid_google
LGTM https://codereview.appspot.com/283510043/diff/40001/tests/com/google/caja/ses/test-ses-parts.js File tests/com/google/caja/ses/test-ses-parts.js (right): https://codereview.appspot.com/283510043/diff/40001/tests/com/google/caja/ses/test-ses-parts.js#newcode183 tests/com/google/caja/ses/test-ses-parts.js:183: jsunitRegister('testAtLeastFreeVarNamesOnNewUnicodeEscapes', function() { I think this deserves a ...
8 years, 1 month ago (2016-03-08 17:33:18 UTC) #8
MarkM
ES6 extended the syntax of identifiers to include the unicode escape sequence backslash-u-opencurly-hexdigits-closecurly. This meant ...
8 years, 1 month ago (2016-03-08 18:18:19 UTC) #9
MarkM
Hi Kevin, all done. Since this is undisclosed, am I done on my end? Are ...
8 years, 1 month ago (2016-03-08 18:20:15 UTC) #10
kpreid_google
8 years, 1 month ago (2016-03-08 18:20:51 UTC) #11
On 2016/03/08 18:20:15, MarkM wrote:
> Hi Kevin, all done. Since this is undisclosed, am I done on my end? Are you
> taking it from here?

Yes.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b