New issue
Advanced search Search tips

Issue 842545 link

Starred by 3 users

Issue metadata

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



Sign in to add a comment

Heap-use-after-free in TabStripModel::SendDetachWebContentsNotifications

Project Member Reported by ClusterFuzz, May 13 2018

Issue description

Detailed report: https://clusterfuzz.com/testcase?key=5447007976816640

Fuzzer: attekett_dom_fuzzer
Job Type: linux_asan_chrome_media
Platform Id: linux

Crash Type: Heap-use-after-free READ 8
Crash Address: 0x608000156e40
Crash State:
  TabStripModel::SendDetachWebContentsNotifications
  TabStripModel::CloseWebContentses
  TabStripModel::InternalCloseTabs
  
Sanitizer: address (ASAN)

Recommended Security Severity: Critical

Regressed: https://clusterfuzz.com/revisions?job=linux_asan_chrome_media&range=557904:557910

Reproducer Testcase: https://clusterfuzz.com/download?testcase_id=5447007976816640

Issue filed automatically.

See https://github.com/google/clusterfuzz-tools for more information.
 
Project Member

Comment 1 by ClusterFuzz, May 13 2018

Components: UI>Browser>TabStrip
Labels: Test-Predator-Auto-Components
Automatically applying components based on crash stacktrace and information from OWNERS files.

If this is incorrect, please apply the Test-Predator-Wrong-Components label.
Project Member

Comment 2 by ClusterFuzz, May 13 2018

Labels: Test-Predator-Auto-Owner
Owner: erikc...@chromium.org
Status: Assigned (was: Untriaged)
Automatically assigning owner based on suspected regression changelist https://chromium.googlesource.com/chromium/src/+/2969739effcde2fdba105d25d8db903bdfdb5db0 (Explicit ownership semantics for TabStripModel.).

If this is incorrect, please let us know why and apply the Test-Predator-Wrong-CLs label. If you aren't the correct owner for this issue, please unassign yourself as soon as possible so it can be re-triaged.
Project Member

Comment 3 by sheriffbot@chromium.org, May 14 2018

Labels: M-68
Project Member

Comment 4 by sheriffbot@chromium.org, May 14 2018

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

If this doesn't affect a release branch, or has not been properly classified for severity, please update the Security_Impact or Security_Severity labels, and remove the ReleaseBlock label. To disable this altogether, apply ReleaseBlock-NA.

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

Comment 5 by sheriffbot@chromium.org, May 14 2018

Labels: Pri-0
This bug is caused by the JavascriptDialogTabHelper failing to deregister itself as a TabStripModel observer when it's destroyed.

https://cs.chromium.org/chromium/src/chrome/browser/ui/javascript_dialogs/javascript_dialog_tab_helper.cc?type=cs&q=JavaScriptDialogTabHelper&sq=package:chromium&g=0&l=523

I'm guessing my CL changed around some timings that made this occur more frequently/on paths that ASAN could catch.
Cc: erikc...@chromium.org
 Issue 842454  has been merged into this issue.
Cc: sky@chromium.org a...@chromium.org
My CL increases the frequency of an existing UaF.

JavascriptDialogTabHelper fails to correctly deal with the case where a WebContents is first removed from the tab strip,  and then destroyed. My CL makes it so that this ordering is the norm, rather than the exception.

Initially, this caused an immediate crash. The following CL:
https://bugs.chromium.org/p/chromium/issues/detail?id=786178#c4

prevented the crash from occurring immediately, but caused the JavascriptDialogTabHelper to fail to deregister itself as the TabStripModel observer, which would cause UaF. 


Project Member

Comment 9 by bugdroid1@chromium.org, May 14 2018

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

commit 3d4023a5e2cf54a1d5faa4a22f79f01f5eaa0667
Author: erikchen <erikchen@chromium.org>
Date: Mon May 14 19:08:03 2018

Fix use after free in JavaScriptDialogTabHelper.

Any time the WebContents is removed from the TabStripModel and then destroyed,
JavaScriptDialogTabHelper would fail to deregister itself as an observer of the
TabStripModel. This would cause use after free.

Change-Id: I162f5f7c65b0b2848a922130cefc31348eeecc6e
Bug:  842545 
Reviewed-on: https://chromium-review.googlesource.com/1057873
Commit-Queue: Erik Chen <erikchen@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#558403}
[modify] https://crrev.com/3d4023a5e2cf54a1d5faa4a22f79f01f5eaa0667/chrome/browser/ui/javascript_dialogs/javascript_dialog_tab_helper.cc
[modify] https://crrev.com/3d4023a5e2cf54a1d5faa4a22f79f01f5eaa0667/chrome/browser/ui/javascript_dialogs/javascript_dialog_tab_helper.h

Status: Fixed (was: Assigned)
Project Member

Comment 11 by ClusterFuzz, May 15 2018

ClusterFuzz has detected this issue as fixed in range 558386:558403.

Detailed report: https://clusterfuzz.com/testcase?key=5447007976816640

Fuzzer: attekett_dom_fuzzer
Job Type: linux_asan_chrome_media
Platform Id: linux

Crash Type: Heap-use-after-free READ 8
Crash Address: 0x608000156e40
Crash State:
  TabStripModel::SendDetachWebContentsNotifications
  TabStripModel::CloseWebContentses
  TabStripModel::InternalCloseTabs
  
Sanitizer: address (ASAN)

Recommended Security Severity: Critical

Regressed: https://clusterfuzz.com/revisions?job=linux_asan_chrome_media&range=557904:557910
Fixed: https://clusterfuzz.com/revisions?job=linux_asan_chrome_media&range=558386:558403

Reproducer Testcase: https://clusterfuzz.com/download?testcase_id=5447007976816640

See https://github.com/google/clusterfuzz-tools for more information.

If you suspect that the result above is incorrect, try re-doing that job on the test case report page.
Project Member

Comment 12 by ClusterFuzz, May 15 2018

Labels: ClusterFuzz-Verified
Status: Verified (was: Fixed)
ClusterFuzz testcase 5447007976816640 is verified as fixed, so closing issue as verified.

If this is incorrect, please add ClusterFuzz-Wrong label and re-open the issue.
Project Member

Comment 13 by sheriffbot@chromium.org, May 15 2018

Labels: -Restrict-View-SecurityTeam Restrict-View-SecurityNotify
Labels: -reward-topanel reward-0
Also found by inferno_twister_c I'm afraid.
Labels: -ReleaseBlock-Beta
Project Member

Comment 16 by sheriffbot@chromium.org, Aug 21

Labels: -Restrict-View-SecurityNotify allpublic
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
Issue 811761 has been merged into this issue.

Sign in to add a comment