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

Issue 27090: Reimplement safeJSON using native JSON/json_sans_eval and revivers/replacers. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
17 years ago by MikeSamuel
Modified:
16 years, 8 months ago
Reviewers:
MarkM
CC:
google-caja-discuss_googlegroups.com
Base URL:
http://google-caja.googlecode.com/svn/trunk/
Visibility:
Public.

Description

Replaces the stopgap fix to security issue 978 with a longer term solution. http://code.google.com/p/google-caja/issues/detail?id=978 However, our current implementation of JSON.parse omits the reviver parameter. So long as the reviver is omitted, it is fine to wait until a JSON parse completes to post process with something like initializeMap. But once we support the ES3.1 JSON API (i.e., approximately the json2.js API), then we need to do our postprocessing before any user-provided reviver is run. On platforms implementing the ES3.1 JSON directly, can have the built in JSON implementation do all this interleaved with parsing, in one pass. To do so, we'd provide a tamedJSON whose parse wraps the user-provided reviver in one that first applies our own postprocess before invoking the user provided reviver. Submitted @3498

Patch Set 1 #

Total comments: 11

Patch Set 2 : Reimplement safeJSON using native JSON/json_sans_eval and revivers/replacers. #

Total comments: 7

Patch Set 3 : Reimplement safeJSON using native JSON/json_sans_eval and revivers/replacers. #

Patch Set 4 : Reimplement safeJSON using native JSON/json_sans_eval and revivers/replacers. #

Patch Set 5 : Reimplement safeJSON using native JSON/json_sans_eval and revivers/replacers. #

Patch Set 6 : Reimplement safeJSON using native JSON/json_sans_eval and revivers/replacers. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1142 lines, -1066 lines) Patch
M build.xml View 2 3 4 5 7 chunks +8 lines, -1 line 0 comments Download
M src/com/google/caja/cajita.js View 1 2 3 4 5 44 chunks +124 lines, -252 lines 0 comments Download
M src/com/google/caja/demos/applet/index.html View 2 chunks +6 lines, -5 lines 0 comments Download
M src/com/google/caja/plugin/stages/CajaRuntimeDebuggingRewriter.java View 2 chunks +2 lines, -2 lines 0 comments Download
M src/com/google/caja/plugin/stages/ValidateJavascriptStage.java View 1 chunk +1 line, -2 lines 0 comments Download
M src/com/google/caja/service/CajolingService.java View 6 chunks +7 lines, -7 lines 0 comments Download
M src/com/google/caja/service/InnocentHandler.java View 2 chunks +1 line, -4 lines 0 comments Download
M tests/com/google/caja/CajitaTest.java View 1 2 3 4 5 3 chunks +47 lines, -22 lines 0 comments Download
M tests/com/google/caja/demos/applet/testbed_test.html View 1 chunk +1 line, -0 lines 0 comments Download
M tests/com/google/caja/demos/calendar/event_store_test.html View 4 5 1 chunk +3 lines, -0 lines 0 comments Download
M tests/com/google/caja/demos/calendar/hcalendar_test.html View 4 5 1 chunk +1 line, -0 lines 0 comments Download
M tests/com/google/caja/demos/calendar/layout_test.html View 4 5 1 chunk +1 line, -0 lines 0 comments Download
M tests/com/google/caja/parser/quasiliteral/CajitaRewriterTest.java View 4 5 2 chunks +4 lines, -0 lines 0 comments Download
M tests/com/google/caja/parser/quasiliteral/DefaultValijaRewriterTest.java View 4 5 2 chunks +4 lines, -0 lines 0 comments Download
M tests/com/google/caja/parser/quasiliteral/InnocentCodeRewriterTest.java View 4 5 2 chunks +4 lines, -0 lines 0 comments Download
M tests/com/google/caja/parser/quasiliteral/taming_test.html View 1 chunk +1 line, -0 lines 0 comments Download
M tests/com/google/caja/parser/quasiliteral/valija_module_loading.html View 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M tests/com/google/caja/plugin/HtmlCompiledPluginTest.java View 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M tests/com/google/caja/plugin/stages/DebuggingSymbolsStageTest.java View 4 5 3 chunks +5 lines, -1 line 0 comments Download
M tests/com/google/caja/util/CajaTestCase.java View 4 5 2 chunks +6 lines, -2 lines 0 comments Download
D third_party/js/json/LICENSE View 2 3 4 5 1 chunk +0 lines, -3 lines 0 comments Download
D third_party/js/json/json2.js View 2 3 4 5 1 chunk +0 lines, -461 lines 0 comments Download
A third_party/js/json_sans_eval/LICENSE.txt View 1 chunk +176 lines, -0 lines 0 comments Download
A third_party/js/json_sans_eval/README.txt View 1 chunk +35 lines, -0 lines 0 comments Download
A third_party/js/json_sans_eval/json_sans_eval.js View 1 chunk +237 lines, -0 lines 0 comments Download
A third_party/js/prettify/lang-css.js View 1 chunk +65 lines, -0 lines 0 comments Download
A third_party/js/prettify/prettify.css View 1 chunk +27 lines, -0 lines 0 comments Download
MM third_party/js/prettify/prettify.js View 5 25 chunks +372 lines, -304 lines 0 comments Download

Messages

Total messages: 7
MikeSamuel
17 years ago (2009-03-20 21:36:50 UTC) #1
MarkM
Sorry this took so long. http://codereview.appspot.com/27090/diff/1/3 File src/com/google/caja/cajita.js (right): http://codereview.appspot.com/27090/diff/1/3#newcode128 Line 128: * of http://code.google.com/p/json-sans-eval/. ...
16 years, 11 months ago (2009-04-22 05:53:36 UTC) #2
MikeSamuel
http://codereview.appspot.com/27090/diff/1/3 File src/com/google/caja/cajita.js (right): http://codereview.appspot.com/27090/diff/1/3#newcode128 Line 128: * of http://code.google.com/p/json-sans-eval/. Removed http://codereview.appspot.com/27090/diff/1/3#newcode138 Line 138: if ...
16 years, 11 months ago (2009-04-24 01:14:43 UTC) #3
MarkM
On 2009/04/24 01:14:43, MikeSamuel wrote: > http://codereview.appspot.com/27090/diff/1/3#newcode138 > Line 138: if (!this.JSON || !this.JSON.parse > ...
16 years, 11 months ago (2009-04-24 01:43:53 UTC) #4
MarkM
LGTM http://codereview.appspot.com/27090/diff/3001/2005 File src/com/google/caja/cajita.js (right): http://codereview.appspot.com/27090/diff/3001/2005#newcode25 Line 25: * @provides ___, cajita, funcBind, safeJSON Given ...
16 years, 11 months ago (2009-04-24 01:44:34 UTC) #5
MikeSamuel
http://codereview.appspot.com/27090/diff/3001/2005 File src/com/google/caja/cajita.js (right): http://codereview.appspot.com/27090/diff/3001/2005#newcode25 Line 25: * @provides ___, cajita, funcBind, safeJSON On 2009/04/24 ...
16 years, 11 months ago (2009-04-24 16:01:31 UTC) #6
MikeSamuel
16 years, 11 months ago (2009-04-24 20:43:22 UTC) #7
Checked the testbed and snapshotted.
Sign in to reply to this message.

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