New issue
Advanced search Search tips

Issue 625475 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Oct 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Chrome , Mac
Pri: 2
Type: Bug-Security



Sign in to add a comment

Security: type confusion in GuestViewInternalCustomBindings::RegisterElementResizeCallback

Reported by jinmot...@gmail.com, Jul 3 2016

Issue description

VULNERABILITY DETAILS
There is a type confusion in guest_view_internal native module on extension system.
when calling requireNative('guest_view_internal').RegisterElementResizeCallback, if another type of window is provided, it causes type confusion.

on line 382:
  int element_instance_id = args[0]->Int32Value();
  // An element instance ID uniquely identifies a ExtensionsGuestViewContainer
  // within a RenderView.
  auto* guest_view_container = static_cast<ExtensionsGuestViewContainer*>(
      guest_view::GuestViewContainer::FromID(element_instance_id)); <-- static_cast to ExtensionGuestViewContainer, but other subclasses can be returned.
  if (!guest_view_container)
    return;

and GuestViewContainer has 3 subclasses:
     20 class ExtensionsGuestViewContainer : public guest_view::GuestViewContainer {
     41 class MimeHandlerViewContainer : public guest_view::GuestViewContainer,
     17 class IframeGuestViewContainer : public GuestViewContainer {

MimeHandlerViewContainer is used on processing PDF files and it registers id for GuestViewContainer::FromID.

VERSION
Chrome Version: 51.0.2704.84 stable 32bit
Operating System: Windows 10 x64

REPRODUCTION CASE
I couldn't attach a PoC since the bug I used was patched, but the flow is like:

<object data="<some pdf path>" type="application/pdf" />
...
<script>
setInterval(function(){ chrome.runtime; }, 1000);

// Then breakpoint to runtime module, and refresh. What you need to do is executing the script below as code.
// for(var i = 0; i < 50000; i++) requireNative('guest_view_internal').RegisterElementResizeCallback(i, function() {});
</script>

It crashes on Windows chrome.
 
Reproduction case is similar to bug 574896 case:
https://www.youtube.com/watch?v=bkM6EiUzy-4&feature=youtu.be
Cc: rdevlin....@chromium.org
Components: Platform>Extensions
Labels: OS-Chrome OS-Linux OS-Mac OS-Windows
Owner: mea...@chromium.org
Status: Assigned (was: Unconfirmed)
Assigning to meacer to triage.
Labels: M-54 Security_Impact-Stable Security_Severity-Low Pri-1
Project Member

Comment 4 by sheriffbot@chromium.org, Jul 5 2016

Labels: -Pri-1 Pri-2

Comment 5 by meacer@google.com, Aug 23 2016

Argh, I missed this bug too, apologies. I feel like this could be medium severity too, even though there is an interaction requirement.

Not sure what the best fix is, short of adding a type field to GuestViewContainer. Devlin, what do you think?

Comment 6 by mea...@chromium.org, Oct 17 2016

Labels: -Security_Severity-Low Security_Severity-Medium
Status: Started (was: Assigned)
Same issue exists for IframeGuestViewContainer because of the cast in GuestViewInternalCustomBindings::AttachIframeGuest. This crashes the renderer:

for(var i = 0; i < 50000; i++) requireNative('guest_view_internal').AttachIframeGuest(i, function() {})

Bumping severity to medium since this doesn't require an extension install, but it requires another bug to get hold of requireNative.

Comment 7 by mea...@chromium.org, Oct 17 2016

Cc: mea...@chromium.org
Components: Platform>Apps>BrowserTag
Owner: lazyboy@chromium.org
Status: Assigned (was: Started)
lazyboy: Can you PTAL or reassign as appropriate? Thanks.
Owner: wjmaclean@chromium.org
Assigning to James.
Project Member

Comment 9 by sheriffbot@chromium.org, Oct 18 2016

wjmaclean: Uh oh! This issue still open and hasn't been updated in the last 107 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
Cc: wjmaclean@chromium.org
Owner: lfg@chromium.org
Lucas, could you take a look at this please?

Comment 11 by lfg@chromium.org, Oct 18 2016

Labels: Needs-Feedback
Re# 6: What's the callstack of the renderer crash? The cast in AttachIframeGuest should be harmless, except for perhaps leaking memory if you do that repeatedly.

The original reported one is definitely a bug that should be fixed.

Comment 13 by lfg@chromium.org, Oct 21 2016

Status: Fixed (was: Assigned)

Comment 14 by lfg@chromium.org, Oct 21 2016

Given the low impact and requirements to reproduce the bad cast, I won't be merging this back.

Project Member

Comment 15 by sheriffbot@chromium.org, Oct 22 2016

Labels: -Restrict-View-SecurityTeam Restrict-View-SecurityNotify
Labels: reward-topanel
Project Member

Comment 17 by sheriffbot@chromium.org, Oct 25 2016

Labels: Merge-Request-55

Comment 18 by dimu@chromium.org, Oct 25 2016

Labels: -Merge-Request-55 Merge-Review-55 Hotlist-Merge-Review
[Automated comment] DEPS changes referenced in bugdroid comments, needs manual review.
Cc: awhalley@chromium.org
+awhalley@ for M55 merge review

Comment 20 by lfg@chromium.org, Oct 26 2016

I don't think this is worth merging, but since sheriffbot requested the merge I'll let awhalley make the call.

Labels: -Hotlist-Merge-Review -Merge-Review-55 Merge-Rejected-55
No need to merge this one.
Labels: -reward-topanel reward-0
I'm afraid the panel declined to reward for this bug, given it's pretty highly mitigated.
sad!
Project Member

Comment 24 by sheriffbot@chromium.org, Jan 28 2017

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

Sign in to add a comment