Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(164)

Issue 1203083002: Add a JSON sanitizer. (Closed)

Created:
5 years, 6 months ago by Bernhard Bauer
Modified:
5 years, 5 months ago
CC:
avayvod+watch_chromium.org, chromium-reviews, David Trainor- moved to gerrit, erikwright+watch_chromium.org, jbudorick+watch_chromium.org, kalyank, klundberg+watch_chromium.org, sadrul, Nico, yfriedman+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add a JSON sanitizer. On Android, the JSON sanitizer parses the untrusted JSON in Java and checks it for wellformedness before serializing it again. On desktop platforms it uses SafeJsonParser to parse the JSON out of process, then serializes it again. Also, on Android (where JsonSanitizer is not implemented in terms of the SafeJsonParser) the SafeJsonParser now uses the JsonSanitizer to sanitize its input before parsing it directly in process, instead of starting a new process, which is very costly on Android. BUG=501333 Committed: https://crrev.com/b1704d0c90a6eb1e4d5eb1e83976e5964ee378b7 Cr-Commit-Position: refs/heads/master@{#338495}

Patch Set 1 #

Patch Set 2 : sync #

Patch Set 3 : fixes #

Patch Set 4 : . #

Patch Set 5 : . #

Patch Set 6 : update #

Patch Set 7 : . #

Patch Set 8 : x #

Patch Set 9 : o #

Patch Set 10 : x #

Patch Set 11 : o #

Patch Set 12 : leak #

Patch Set 13 : sync #

Patch Set 14 : fix GN build #

Patch Set 15 : x #

Patch Set 16 : rebase #

Patch Set 17 : rebase #

Patch Set 18 : fix #

Patch Set 19 : x #

Total comments: 16

Patch Set 20 : review #

Patch Set 21 : review #

Patch Set 22 : make sanitize method static #

Patch Set 23 : fix #

Patch Set 24 : GN #

Total comments: 4

Patch Set 25 : review #

Total comments: 3

Patch Set 26 : review #

Patch Set 27 : DEPS #

Patch Set 28 : build files #

Unified diffs Side-by-side diffs Delta from patch set Stats (+931 lines, -13 lines) Patch
M chrome/android/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/android/chrome_jni_registrar.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +2 lines, -0 lines 0 comments Download
M chrome/browser/supervised_user/supervised_user_whitelist_service_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +6 lines, -1 line 0 comments Download
M chrome/chrome.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +2 lines, -1 line 0 comments Download
M chrome/test/base/chrome_test_suite.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 2 chunks +10 lines, -0 lines 0 comments Download
M components/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 1 chunk +4 lines, -1 line 0 comments Download
M components/components_tests.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 4 chunks +7 lines, -0 lines 0 comments Download
M components/safe_json.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 3 chunks +51 lines, -1 line 0 comments Download
M components/safe_json/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 3 chunks +37 lines, -1 line 0 comments Download
M components/safe_json/DEPS View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 1 chunk +4 lines, -2 lines 0 comments Download
A components/safe_json/android/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 1 chunk +22 lines, -0 lines 0 comments Download
A components/safe_json/android/component_jni_registrar.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +19 lines, -0 lines 0 comments Download
A components/safe_json/android/component_jni_registrar.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +25 lines, -0 lines 0 comments Download
A components/safe_json/android/java/src/org/chromium/components/safejson/JsonSanitizer.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +178 lines, -0 lines 0 comments Download
A components/safe_json/json_sanitizer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +52 lines, -0 lines 0 comments Download
A components/safe_json/json_sanitizer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +89 lines, -0 lines 0 comments Download
A components/safe_json/json_sanitizer_android.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +115 lines, -0 lines 0 comments Download
A components/safe_json/json_sanitizer_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +184 lines, -0 lines 0 comments Download
M components/safe_json/safe_json_parser.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3 chunks +19 lines, -3 lines 0 comments Download
A components/safe_json/safe_json_parser_android.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +41 lines, -0 lines 0 comments Download
A components/safe_json/safe_json_parser_android.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +56 lines, -0 lines 0 comments Download
M components/test/DEPS View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M components/test/run_all_unittests.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +5 lines, -3 lines 0 comments Download
M tools/android/eclipse/.classpath View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 25 (5 generated)
Bernhard Bauer
Please review. This CL looks pretty big, but a lot of it is boilerplate code ...
5 years, 5 months ago (2015-07-07 12:12:18 UTC) #2
Robert Sesek
https://codereview.chromium.org/1203083002/diff/350001/components/safe_json/android/component_jni_registrar.h File components/safe_json/android/component_jni_registrar.h (right): https://codereview.chromium.org/1203083002/diff/350001/components/safe_json/android/component_jni_registrar.h#newcode11 components/safe_json/android/component_jni_registrar.h:11: nit: don't need blank lines between non-anonymous nested namespaces ...
5 years, 5 months ago (2015-07-07 21:54:16 UTC) #3
Bernhard Bauer
https://codereview.chromium.org/1203083002/diff/350001/components/safe_json/android/component_jni_registrar.h File components/safe_json/android/component_jni_registrar.h (right): https://codereview.chromium.org/1203083002/diff/350001/components/safe_json/android/component_jni_registrar.h#newcode11 components/safe_json/android/component_jni_registrar.h:11: On 2015/07/07 21:54:15, Robert Sesek wrote: > nit: don't ...
5 years, 5 months ago (2015-07-08 11:54:29 UTC) #4
Robert Sesek
https://codereview.chromium.org/1203083002/diff/350001/components/safe_json/json_sanitizer.h File components/safe_json/json_sanitizer.h (right): https://codereview.chromium.org/1203083002/diff/350001/components/safe_json/json_sanitizer.h#newcode26 components/safe_json/json_sanitizer.h:26: class JsonSanitizer { On 2015/07/08 11:54:29, Bernhard Bauer wrote: ...
5 years, 5 months ago (2015-07-08 19:24:07 UTC) #5
Bernhard Bauer
https://codereview.chromium.org/1203083002/diff/350001/components/safe_json/json_sanitizer.h File components/safe_json/json_sanitizer.h (right): https://codereview.chromium.org/1203083002/diff/350001/components/safe_json/json_sanitizer.h#newcode26 components/safe_json/json_sanitizer.h:26: class JsonSanitizer { On 2015/07/08 19:24:07, Robert Sesek wrote: ...
5 years, 5 months ago (2015-07-08 21:56:48 UTC) #6
Robert Sesek
https://codereview.chromium.org/1203083002/diff/350001/components/safe_json/json_sanitizer.h File components/safe_json/json_sanitizer.h (right): https://codereview.chromium.org/1203083002/diff/350001/components/safe_json/json_sanitizer.h#newcode26 components/safe_json/json_sanitizer.h:26: class JsonSanitizer { On 2015/07/08 21:56:47, Bernhard Bauer wrote: ...
5 years, 5 months ago (2015-07-08 22:00:44 UTC) #7
Bernhard Bauer
https://codereview.chromium.org/1203083002/diff/350001/components/safe_json/json_sanitizer.h File components/safe_json/json_sanitizer.h (right): https://codereview.chromium.org/1203083002/diff/350001/components/safe_json/json_sanitizer.h#newcode26 components/safe_json/json_sanitizer.h:26: class JsonSanitizer { On 2015/07/08 22:00:43, Robert Sesek wrote: ...
5 years, 5 months ago (2015-07-09 12:34:49 UTC) #8
Robert Sesek
LGTM
5 years, 5 months ago (2015-07-09 15:04:14 UTC) #9
Bernhard Bauer
Adding OWNERS (Nico for chrome/, Sylvain for components).
5 years, 5 months ago (2015-07-09 15:19:14 UTC) #11
sdefresne
lgtm https://codereview.chromium.org/1203083002/diff/450001/components/BUILD.gn File components/BUILD.gn (right): https://codereview.chromium.org/1203083002/diff/450001/components/BUILD.gn#newcode352 components/BUILD.gn:352: "//components/safe_json:unit_tests", I don't understand this addition. At line ...
5 years, 5 months ago (2015-07-10 14:01:19 UTC) #12
Bernhard Bauer
Thanks for the review! https://codereview.chromium.org/1203083002/diff/450001/components/BUILD.gn File components/BUILD.gn (right): https://codereview.chromium.org/1203083002/diff/450001/components/BUILD.gn#newcode352 components/BUILD.gn:352: "//components/safe_json:unit_tests", On 2015/07/10 14:01:19, sdefresne ...
5 years, 5 months ago (2015-07-10 14:09:09 UTC) #13
Bernhard Bauer
Jochen, could I get an OWNERS review for chrome/test/base/chrome_test_suite.cc and chrome/chrome.gyp?
5 years, 5 months ago (2015-07-13 09:13:25 UTC) #15
jochen (gone - plz use gerrit)
lgtm with comment https://codereview.chromium.org/1203083002/diff/470001/components/safe_json/DEPS File components/safe_json/DEPS (right): https://codereview.chromium.org/1203083002/diff/470001/components/safe_json/DEPS#newcode3 components/safe_json/DEPS:3: "+content/public", please restrict to c/p/browser
5 years, 5 months ago (2015-07-13 09:16:17 UTC) #16
Bernhard Bauer
https://codereview.chromium.org/1203083002/diff/470001/components/safe_json/DEPS File components/safe_json/DEPS (right): https://codereview.chromium.org/1203083002/diff/470001/components/safe_json/DEPS#newcode3 components/safe_json/DEPS:3: "+content/public", On 2015/07/13 09:16:17, jochen wrote: > please restrict ...
5 years, 5 months ago (2015-07-13 09:41:40 UTC) #17
Bernhard Bauer
https://codereview.chromium.org/1203083002/diff/470001/components/safe_json/DEPS File components/safe_json/DEPS (right): https://codereview.chromium.org/1203083002/diff/470001/components/safe_json/DEPS#newcode3 components/safe_json/DEPS:3: "+content/public", On 2015/07/13 09:41:40, Bernhard Bauer wrote: > On ...
5 years, 5 months ago (2015-07-13 09:43:25 UTC) #18
jochen (gone - plz use gerrit)
On 2015/07/13 at 09:43:25, bauerb wrote: > https://codereview.chromium.org/1203083002/diff/470001/components/safe_json/DEPS > File components/safe_json/DEPS (right): > > https://codereview.chromium.org/1203083002/diff/470001/components/safe_json/DEPS#newcode3 ...
5 years, 5 months ago (2015-07-13 09:44:38 UTC) #19
Bernhard Bauer
On 2015/07/13 09:44:38, jochen wrote: > On 2015/07/13 at 09:43:25, bauerb wrote: > > > ...
5 years, 5 months ago (2015-07-13 09:55:11 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1203083002/530001
5 years, 5 months ago (2015-07-13 10:56:20 UTC) #23
commit-bot: I haz the power
Committed patchset #28 (id:530001)
5 years, 5 months ago (2015-07-13 11:05:53 UTC) #24
commit-bot: I haz the power
5 years, 5 months ago (2015-07-13 11:06:49 UTC) #25
Message was sent while issue was closed.
Patchset 28 (id:??) landed as
https://crrev.com/b1704d0c90a6eb1e4d5eb1e83976e5964ee378b7
Cr-Commit-Position: refs/heads/master@{#338495}

Powered by Google App Engine
This is Rietveld 408576698