New issue
Advanced search Search tips

Issue 608817 link

Starred by 0 users

Issue metadata

Status: Verified
Owner:
Closed: May 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 1
Type: Bug-Security



Sign in to add a comment

Heap-use-after-free in blink::LayoutObject::containingBlock

Project Member Reported by ClusterFuzz, May 3 2016

Issue description

Detailed report: https://cluster-fuzz.appspot.com/testcase?key=6516471743643648

Fuzzer: attekett_dom_fuzzer
Job Type: linux_asan_chrome_mp
Platform Id: linux

Crash Type: Heap-use-after-free READ 8
Crash Address: 0x611000045de0
Crash State:
  blink::LayoutObject::containingBlock
  blink::CaretBase::invalidateLocalCaretRect
  blink::FrameSelection::nodeWillBeRemoved
  
Recommended Security Severity: High

Regressed: https://cluster-fuzz.appspot.com/revisions?job=linux_asan_chrome_mp&range=390316:390338

Minimized Testcase (0.57 Kb): https://cluster-fuzz.appspot.com/download/AMIfv96LcBCWrW__6eLF2JDpCkRqR9C1uB8whADDZy4rjCJiTO9Wp7WQSBvOfkMckfO__vE_X6c9ZNYQ7fu9e9IvkAx0BaXl0Rd2voMz1DSzudx0OxUm1tIivC22wvS-5OSFecG-oqoMTg0X8fWoeqWsNnGcw3zaBA

Filer: ochang

See https://dev.chromium.org/Home/chromium-security/bugs/reproducing-clusterfuzz-bugs for more information.
 
Project Member

Comment 1 by sheriffbot@chromium.org, May 4 2016

Labels: M-52
Project Member

Comment 2 by sheriffbot@chromium.org, May 4 2016

Labels: ReleaseBlock-Beta
This issue is a security regression. If you are not able to fix this quickly, please revert the change that introduced it.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Project Member

Comment 3 by sheriffbot@chromium.org, May 4 2016

Labels: Pri-1

Comment 4 by f...@chromium.org, May 6 2016

Components: Blink>Layout
Owner: tkent@chromium.org
tkent@, could you please take a look? Could this have been caused by https://chromium.googlesource.com/chromium/src//+/5bfffca95444ba872b0a7faeaf956e92ab18639f?

Comment 5 by tkent@chromium.org, May 6 2016

Cc: yosin@chromium.org
Components: -Blink>Layout Blink>HTML>Meter Blink>TextSelection
Status: Assigned (was: Available)
It seems HTMLMeterElement::canContainRangeEndPoint() triggers this issue.

Comment 6 by tkent@chromium.org, May 6 2016

Cleaner repro:

<style></style>
<div id="d" contenteditable=""></div>
<script>
var test0 = document.getElementById("d")
test0.focus();
test0.appendChild(document.createElement("meter"))
setTimeout(function() {
  document.styleSheets[0].insertRule('#d {content: counter(c, katakana);}');
  test0.textContent = "PASS";
})
</script>

Comment 7 by tkent@chromium.org, May 9 2016

In CaretBase::caretLayoutObject(Node* node).
 - |node| is being detached from the document tree, and it has an obsolete LayoutObject.
 - caretRendersInsideNode(node) in this function calls HTMLMeterElement::canContainRangeEndPoint(), and it updates the layout tree.  It means LayoutObject for the METER is deleted.
 - Local variable |layoutObject| becomes a stale pointer.

I think we may remove updateLayoutTreeForForNode() in HTMLMeterElement::canContainRangeEndPoint().

Comment 8 by tkent@chromium.org, May 9 2016

Status: Started (was: Assigned)

Comment 9 by tkent@chromium.org, May 9 2016

Cc: -yosin@chromium.org tkent@chromium.org yoichio@chromium.org
Owner: yosin@chromium.org
Status: Assigned (was: Started)
yosin@ takes this over.

We should keep LayoutObject in CaretBase to avoid calling caretLayoutObject() with updating layout object at recalc style, and layout change.
Cc: -yoichio@chromium.org yosin@chromium.org
Owner: yoichio@chromium.org
Project Member

Comment 12 by sheriffbot@chromium.org, May 18 2016

yoichio: Uh oh! This issue still open and hasn't been updated in the last 14 days. This is a serious vulnerability, and we want to ensure that there's progress. Could you please leave an update with the current status and any potential blockers?

If you're not the right owner for this issue, could you please remove yourself as soon as possible or help us find the right one?

If the issue is fixed or you can't reproduce it, please close the bug. If you've started working on a fix, please set the status to Started.

Thanks for your time! To disable nags, add the Disable-Nags label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
yoichio@, do you have any updates on this? Thanks!
This is Heap-use-after-free security bug. 
Sanity of the script and usage in wild is important index to prioritize?
Other such bugs from clusterfuzz have been fixed quickly.
https://bugs.chromium.org/p/chromium/issues/list?can=1&q=Heap-use-after-free+clusterfuzz&colspec=ID+Pri+M+Stars+ReleaseBlock+Component+Status+Owner+Summary+OS+Modified&x=m&y=releaseblock&cells=ids

WDYK, yosin@?
We're doing a security fix-it right now; would it be possible to get this fixed this week?
I'm working on this issue.
Project Member

Comment 17 by bugdroid1@chromium.org, May 25 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e4edfb63d1b068c5ab5dc6b91edf75c108ebc433

commit e4edfb63d1b068c5ab5dc6b91edf75c108ebc433
Author: yoichio <yoichio@chromium.org>
Date: Wed May 25 07:23:06 2016

Check node->layoutObject in CaretBase::caretLayoutObject

In CaretBase::caretLayoutObject(Node* node),
if caretRendersInsideNode(node) calls HTMLMeterElement::canContainRangeEndPoint,
 it updates the layout tree.  It means LayoutObject for the METER can be deleted.
This is bad design. We should make caret painting algorithm clean.

BUG= 608817 

Review-Url: https://codereview.chromium.org/1972523002
Cr-Commit-Position: refs/heads/master@{#395822}

[modify] https://crrev.com/e4edfb63d1b068c5ab5dc6b91edf75c108ebc433/third_party/WebKit/Source/core/editing/CaretBase.cpp

Status: Fixed (was: Assigned)
Project Member

Comment 19 by ClusterFuzz, May 25 2016

Labels: Merge-Triage
Adding Merge-Triage label for tracking purposes.

Once your fix had sufficient bake time (on canary, dev as appropriate), please nominate your fix for merge by adding the Merge-Request-XX label, where XX is the Chrome milestone.

When your merge is approved by the release manager, please start merging with higher milestone label first. Make sure to re-request merge for every milestone in the label list. You can get branch information on omahaproxy.appspot.com.

- Your friendly ClusterFuzz
Project Member

Comment 20 by sheriffbot@chromium.org, May 25 2016

Labels: -Restrict-View-SecurityTeam Restrict-View-SecurityNotify
Thanks yoichio!
Labels: -Merge-Triage Merge-Request-52

Comment 23 by tin...@google.com, Jun 6 2016

Labels: -Merge-Request-52 Merge-Approved-52 Hotlist-Merge-Approved
Your change meets the bar and is auto-approved for M52 (branch: 2743)
Please merge your change to M52 branch 2743 before 3:00 PM PST tomorrow, Tuesday (06/07) so we can take it for this week beta release. Thank you.
Project Member

Comment 25 by bugdroid1@chromium.org, Jun 7 2016

Labels: -merge-approved-52 merge-merged-2743
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/59c23e7f2a1eeeafa8040eb50a193f2e3a29a02f

commit 59c23e7f2a1eeeafa8040eb50a193f2e3a29a02f
Author: Yoichi Osato <yoichio@chromium.org>
Date: Tue Jun 07 02:17:39 2016

Check node->layoutObject in CaretBase::caretLayoutObject

In CaretBase::caretLayoutObject(Node* node),
if caretRendersInsideNode(node) calls HTMLMeterElement::canContainRangeEndPoint,
 it updates the layout tree.  It means LayoutObject for the METER can be deleted.
This is bad design. We should make caret painting algorithm clean.

BUG= 608817 

Review-Url: https://codereview.chromium.org/1972523002
Cr-Commit-Position: refs/heads/master@{#395822}
(cherry picked from commit e4edfb63d1b068c5ab5dc6b91edf75c108ebc433)

Review URL: https://codereview.chromium.org/2042153002 .

Cr-Commit-Position: refs/branch-heads/2743@{#256}
Cr-Branched-From: 2b3ae3b8090361f8af5a611712fc1a5ab2de53cb-refs/heads/master@{#394939}

[modify] https://crrev.com/59c23e7f2a1eeeafa8040eb50a193f2e3a29a02f/third_party/WebKit/Source/core/editing/CaretBase.cpp

Project Member

Comment 26 by ClusterFuzz, Jun 9 2016

ClusterFuzz has detected this issue as fixed in range 395786:395828.

Detailed report: https://cluster-fuzz.appspot.com/testcase?key=6516471743643648

Fuzzer: attekett_dom_fuzzer
Job Type: linux_asan_chrome_mp
Platform Id: linux

Crash Type: Heap-use-after-free READ 8
Crash Address: 0x611000045de0
Crash State:
  blink::LayoutObject::containingBlock
  blink::CaretBase::invalidateLocalCaretRect
  blink::FrameSelection::nodeWillBeRemoved
  
Recommended Security Severity: High

Regressed: https://cluster-fuzz.appspot.com/revisions?job=linux_asan_chrome_mp&range=390316:390338
Fixed: https://cluster-fuzz.appspot.com/revisions?job=linux_asan_chrome_mp&range=395786:395828

Unminimized Testcase: https://cluster-fuzz.appspot.com/download/AMIfv94_DGoNp8fVMd_haDgN_JwnuqFwPLdptMj-On8JzzwoIHQhKKVVFFsq6to-ulZIM7beD3c_0wvmRbz-hVqURKSZ50yS6oAZg93uvhqRgAmse4ai5ZeCsD649OKJMOm6rB0U0Il7wMvrz4uPYUkXUGGo2ZR3U1OZScEvabEhiy0dOjGGuFg


See https://dev.chromium.org/Home/chromium-security/bugs/reproducing-clusterfuzz-bugs for more information.

If you suspect that the result above is incorrect, try re-doing that job on the test case report page.
Status: Verified (was: Fixed)
Project Member

Comment 28 by bugdroid1@chromium.org, Jun 15 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/59c23e7f2a1eeeafa8040eb50a193f2e3a29a02f

commit 59c23e7f2a1eeeafa8040eb50a193f2e3a29a02f
Author: Yoichi Osato <yoichio@chromium.org>
Date: Tue Jun 07 02:17:39 2016

Check node->layoutObject in CaretBase::caretLayoutObject

In CaretBase::caretLayoutObject(Node* node),
if caretRendersInsideNode(node) calls HTMLMeterElement::canContainRangeEndPoint,
 it updates the layout tree.  It means LayoutObject for the METER can be deleted.
This is bad design. We should make caret painting algorithm clean.

BUG= 608817 

Review-Url: https://codereview.chromium.org/1972523002
Cr-Commit-Position: refs/heads/master@{#395822}
(cherry picked from commit e4edfb63d1b068c5ab5dc6b91edf75c108ebc433)

Review URL: https://codereview.chromium.org/2042153002 .

Cr-Commit-Position: refs/branch-heads/2743@{#256}
Cr-Branched-From: 2b3ae3b8090361f8af5a611712fc1a5ab2de53cb-refs/heads/master@{#394939}

[modify] https://crrev.com/59c23e7f2a1eeeafa8040eb50a193f2e3a29a02f/third_party/WebKit/Source/core/editing/CaretBase.cpp

Labels: -reward-topanel reward-unpaid reward-3500 reward_to-attekett_at_gmail.com
Groovy - $3,500 for this one!
Labels: -reward-unpaid reward-inprocess
Project Member

Comment 31 by sheriffbot@chromium.org, Aug 31 2016

Labels: -Restrict-View-SecurityNotify
This bug has been closed for more than 14 weeks. Removing security view restrictions.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Project Member

Comment 32 by sheriffbot@chromium.org, Oct 1 2016

This bug has been closed for more than 14 weeks. Removing security view restrictions.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Project Member

Comment 33 by sheriffbot@chromium.org, Oct 2 2016

This bug has been closed for more than 14 weeks. Removing security view restrictions.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: allpublic

Comment 35 by tkent@chromium.org, Oct 12 2016

Components: -Blink>TextSelection Blink>Editing>Selection

Sign in to add a comment