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

Issue 2570113002: Increase the depth limit of JSONParser and IPC serialization from 100 to 200. (Closed)

Created:
4 years ago by Joao da Silva
Modified:
3 years, 11 months ago
Reviewers:
Robert Sesek, Nico, jam
CC:
chromium-reviews, darin-cc_chromium.org, vmpstr+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Increase the depth limit of JSONParser and IPC serialization from 100 to 200. This impacts extension APIs and the debug protocol. Some webpages have over 100 levels of nested elements. Some internal representations further use 2 levels per node to represent the DOM data (e.g. one DictionaryValue for the node and a ListValue containing the children.) The affected APIs fail silently when this limit is reached. Percentiles over ~90M random pages: Max depth: go/html-depth Iframes found at depth: go/html-iframe-depth To support 99.9% of pages we need (62 + 35) * 2 == 194 levels of nesting. BUG=673263 Review-Url: https://codereview.chromium.org/2570113002 Cr-Commit-Position: refs/heads/master@{#442542} Committed: https://chromium.googlesource.com/chromium/src/+/383b174a3c321fc6963c50515745d559222ba709

Patch Set 1 #

Patch Set 2 : Increase the depth limit of JSONParser and IPC serialization. #

Patch Set 3 : updated unittest #

Patch Set 4 : fixed another test #

Patch Set 5 : updated JsonSanitizer.java #

Patch Set 6 : updated the limit to 150 #

Patch Set 7 : set recursion limit to 200 #

Total comments: 2

Patch Set 8 : added comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+15 lines, -13 lines) Patch
M base/json/json_parser.cc View 1 2 3 4 5 6 7 1 chunk +3 lines, -1 line 0 comments Download
M base/json/json_parser_unittest.cc View 1 2 3 4 5 6 1 chunk +2 lines, -2 lines 0 comments Download
M components/safe_json/android/java/src/org/chromium/components/safejson/JsonSanitizer.java View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M components/safe_json/json_sanitizer_unittest.cc View 1 2 3 4 5 6 1 chunk +5 lines, -5 lines 0 comments Download
M ipc/ipc_message_utils.cc View 1 2 3 4 5 6 4 chunks +4 lines, -4 lines 0 comments Download

Messages

Total messages: 39 (23 generated)
Joao da Silva
Hi jam, our team hit this while working with some large sites like ebay. I've ...
4 years ago (2016-12-13 18:20:30 UTC) #4
Joao da Silva
4 years ago (2016-12-14 13:20:04 UTC) #16
Bernhard Bauer
+rsesek, fellow safe_json OWNER and lucky winner of the ipc/SECURITY_OWNERS lottery :)
4 years ago (2016-12-14 13:24:07 UTC) #18
Robert Sesek
An order of magnitude more nesting seems like a lot. How many nesting levels does ...
4 years ago (2016-12-14 16:44:48 UTC) #19
Joao da Silva
1000 is a lot more than we need. Ebay hits 111, for example. 200 would ...
4 years ago (2016-12-14 17:16:24 UTC) #20
jam
On 2016/12/13 18:20:30, Joao da Silva wrote: > Hi jam, > > our team hit ...
4 years ago (2016-12-14 17:50:26 UTC) #21
Robert Sesek
On 2016/12/14 17:16:24, Joao da Silva wrote: > 1000 is a lot more than we ...
4 years ago (2016-12-14 19:17:58 UTC) #22
Joao da Silva
On 2016/12/14 19:17:58, Robert Sesek wrote: > On 2016/12/14 17:16:24, Joao da Silva wrote: > ...
4 years ago (2016-12-15 13:18:25 UTC) #24
Robert Sesek
LGTM. Please put in the CL description that we're changing the max limit from 100 ...
4 years ago (2016-12-15 17:38:25 UTC) #25
Joao da Silva
PTAL John: approval for ipc/ Nico: approval for base/ Robert: I've increased the limit to ...
4 years ago (2016-12-16 09:58:35 UTC) #29
jam
On 2016/12/16 09:58:35, Joao da Silva wrote: > PTAL > > John: approval for ipc/ ...
4 years ago (2016-12-19 18:16:10 UTC) #30
Joao da Silva
@thakis ping
3 years, 11 months ago (2017-01-09 08:27:18 UTC) #31
Nico
base/ lgtm https://codereview.chromium.org/2570113002/diff/120001/base/json/json_parser.cc File base/json/json_parser.cc (right): https://codereview.chromium.org/2570113002/diff/120001/base/json/json_parser.cc#newcode27 base/json/json_parser.cc:27: const int kStackMaxDepth = 200; maybe add ...
3 years, 11 months ago (2017-01-09 15:06:03 UTC) #32
Joao da Silva
https://codereview.chromium.org/2570113002/diff/120001/base/json/json_parser.cc File base/json/json_parser.cc (right): https://codereview.chromium.org/2570113002/diff/120001/base/json/json_parser.cc#newcode27 base/json/json_parser.cc:27: const int kStackMaxDepth = 200; On 2017/01/09 15:06:03, Nico ...
3 years, 11 months ago (2017-01-10 08:49:12 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2570113002/140001
3 years, 11 months ago (2017-01-10 08:49:26 UTC) #36
commit-bot: I haz the power
3 years, 11 months ago (2017-01-10 09:56:11 UTC) #39
Message was sent while issue was closed.
Committed patchset #8 (id:140001) as
https://chromium.googlesource.com/chromium/src/+/383b174a3c321fc6963c50515745...

Powered by Google App Engine
This is Rietveld 408576698