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

Issue 2539003002: Make the XML entity recursion check more precise. (Closed)

Created:
4 years ago by dominicc (has gone to gerrit)
Modified:
4 years ago
Reviewers:
scottmg
CC:
blink-reviews, chromium-reviews, dominicc+watchlist_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Make the XML entity recursion check more precise. libxml doesn't detect entity recursion specifically but has a variety of related checks, such as entities not expanding too deeply or producing exponential blow-ups in content. Because entity declarations are parsed in a separate context with their own element recursion budget, a recursive entity can overflow the stack using a lot of open elements (but within the per-context limit) as it slowly consumes (but does not exhaust) the entity depth budget. This adds a specific, precise check for recursive entities that detects entity recursion specifically and fails immediately. The existing entity expansion depth checks are still relevant for long chains of different entities. BUG=628581 Committed: https://crrev.com/acca03bd98815a12daf812471f649041f5381571 Cr-Commit-Position: refs/heads/master@{#436899}

Patch Set 1 #

Total comments: 2

Patch Set 2 : Feedback. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+217 lines, -39 lines) Patch
A third_party/WebKit/LayoutTests/fast/invalid/entity-reference-loop.html View 1 chunk +17 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/fast/invalid/entity-reference-loop-expected.txt View 1 chunk +1 line, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/fast/invalid/resources/entity-reference-loop.xml View 1 chunk +134 lines, -0 lines 0 comments Download
M third_party/libxml/README.chromium View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/libxml/src/entities.c View 1 2 chunks +2 lines, -0 lines 0 comments Download
M third_party/libxml/src/include/libxml/entities.h View 2 chunks +11 lines, -5 lines 0 comments Download
M third_party/libxml/src/parser.c View 3 chunks +51 lines, -34 lines 0 comments Download

Messages

Total messages: 16 (9 generated)
dominicc (has gone to gerrit)
PTAL
4 years ago (2016-11-30 07:51:30 UTC) #4
scottmg
lgtm with a fix to copy (or just explicit initialization if you don't think it ...
4 years ago (2016-11-30 16:22:58 UTC) #7
ddkilzer
https://codereview.chromium.org/2539003002/diff/1/third_party/libxml/src/include/libxml/entities.h File third_party/libxml/src/include/libxml/entities.h (right): https://codereview.chromium.org/2539003002/diff/1/third_party/libxml/src/include/libxml/entities.h#newcode68 third_party/libxml/src/include/libxml/entities.h:68: xmlEntityRecursionGuard guard; FYI, changing struct _xmlEntity (which is vended ...
4 years ago (2016-11-30 23:30:22 UTC) #8
dominicc (has gone to gerrit)
On 2016/11/30 at 23:30:22, ddkilzer wrote: > https://codereview.chromium.org/2539003002/diff/1/third_party/libxml/src/include/libxml/entities.h > File third_party/libxml/src/include/libxml/entities.h (right): > > https://codereview.chromium.org/2539003002/diff/1/third_party/libxml/src/include/libxml/entities.h#newcode68 ...
4 years ago (2016-12-01 01:43:42 UTC) #9
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/2539003002/20001
4 years ago (2016-12-07 07:13:39 UTC) #12
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years ago (2016-12-07 09:40:24 UTC) #14
commit-bot: I haz the power
4 years ago (2016-12-07 09:43:08 UTC) #16
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/acca03bd98815a12daf812471f649041f5381571
Cr-Commit-Position: refs/heads/master@{#436899}

Powered by Google App Engine
This is Rietveld 408576698