Skip to content

Crash calling window.open from sandboxed webview #8378

Closed

Description

@kevinsawicki
  • Electron version: 1.4.14
  • Operating system: macOS

Expected behavior

window.open can be called from a sandboxed <webview> tag.

Actual behavior

Crash occurs:

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Segmentation fault: 11
Termination Reason:    Namespace SIGNAL, Code 0xb
Terminating Process:   exc handler [0]

VM Regions Near 0:
--> 
    __TEXT                 0000000104491000-0000000104492000 [    4K] r-x/rwx SM=COW  /Users/USER/*/Electron.app/Contents/MacOS/Electron

Thread 0 Crashed:: CrBrowserMain  Dispatch queue: com.apple.main-thread

Thread 0 Crashed:: CrBrowserMain  Dispatch queue: com.apple.main-thread
0   com.github.electron.framework 	0x00000001014f3eb1 content::WebContentsImpl::CreateNewWindow(content::SiteInstance*, int, int, int, ViewHostMsg_CreateWindow_Params const&, content::SessionStorageNamespace*) + 769 (web_contents_impl.cc:2044)
1   com.github.electron.framework 	0x0000000101419c78 content::RenderViewHostImpl::CreateNewWindow(int, int, int, ViewHostMsg_CreateWindow_Params const&, content::SessionStorageNamespace*) + 200 (render_view_host_impl.cc:903)
2   com.github.electron.framework 	0x0000000100a8deab base::debug::TaskAnnotator::RunTask(char const*, base::PendingTask const&) + 187 (callback.h:389)
3   com.github.electron.framework 	0x0000000100aaec7c base::MessageLoop::RunTask(base::PendingTask const&) + 508 (vector:640)
4   com.github.electron.framework 	0x0000000100aaef8c base::MessageLoop::DeferOrRunPendingTask(base::PendingTask const&) + 44 (message_loop.cc:502)
5   com.github.electron.framework 	0x0000000100aaf2eb base::MessageLoop::DoWork() + 299 (message_loop.cc:624)
6   com.github.electron.framework 	0x0000000100a8381d base::MessagePumpCFRunLoopBase::RunWork() + 45 (message_pump_mac.mm:330)
7   com.github.electron.framework 	0x0000000100aa5c3a base::mac::CallWithEHFrame(void () block_pointer) + 10 (call_with_eh_frame_asm.S:38)
8   com.github.electron.framework 	0x0000000100a83224 base::MessagePumpCFRunLoopBase::RunWorkSource(void*) + 68 (message_pump_mac.mm:309)

How to reproduce

sandboxed-webview.html

<webview src="./open.html" webpreferences="sandbox=yes" allowpopups></webview>

open.html

<script>window.open('about:blank')</script>

Activity

  1. kevinsawicki commented on Jan 10, 2017

    @kevinsawicki
    ContributorAuthor

    /cc @tarruda are sandboxed <webview> tags valid to use? This was my first time trying one so I wasn't sure if this case is not fully supported yet.

  2. tarruda commented on Jan 11, 2017

    @tarruda
    Contributor

    @kevinsawicki sandbox option is not supported in <webview> yet. I tried to implement but failed and couldn't debug easily(#6919 (comment)). It should not result in crash, however(because the option is ignored, as far as I remember).

  3. kevinsawicki commented on Jan 12, 2017

    @kevinsawicki
    ContributorAuthor

    sandbox option is not supported in yet.

    Okay, closing this out then and it can just be tracked in #6712

    It should not result in crash, however(because the option is ignored, as far as I remember).

    This looks to be happening because BrowserPluginGuestDelegate::CreateNewGuestWindow is not implemented in Electron and it is called from content::WebContentsImpl::CreateNewWindow for guest web contents.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions