Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8096044

[WebView] data-protocol not supported in sandboxed WebView

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3
    • 8u40
    • 8u20
    • javafx
    • Java-Plug-in 11.20.2.26
      JRE-Version verwenden 1.8.0_20-b26 Java HotSpot(TM) Client VM
      Google Chrome Version 37.0.2062.124 m

    • web

    Description

      The data-protocol is not supported if the WebView runs in sandbox mode.

      Example HTML code:
      <img src='data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBwgBAQkIBwgKAQELDRYPDQwMDRsUFRAWIB0iIiARHxMkKDQsJCYxJx8fLT0tMTU3Ojo6Iys/RD84QzQ5OjcBCgoKDQwNGg8PGjclHyU3Nzc3Nzc0NCs3Nzc3NDc3Nzc3Nyw0NDc3Nzc3Nzc3Nzc3Nzc3Nzc3NzQ0Nzc3Nzc3N//AABEIABAAEAMBEQACEQEDEQH/xAAXAAADAQAAAAAAAAAAAAAAAAADBQYC/8QAKBAAAgEDAgUDBQAAAAAAAAAAAQIDBAURBwgABhIhcTFCUQkTIjJD/8QAFwEBAAMAAAAAAAAAAAAAAAAAAgAEBf/EAB4RAAICAgMBAQAAAAAAAAAAAAECAAMRQRITUTEh/9oADAMBAAIRAxEAPwCg5kvNTue1nuSLFJz7t7t7tG8XsUKSrSMvu/IN65wB54z7rGZiB8EoWuXYjQmKOvOwXRCkvCuNHeXp5MiiQdKzQj9pOj0Bx3B8fPERutQx3qRW61De6hb7Z7rsC37T3q2U0mtG3qqZnmiRS2eru8bIMnBOSCAeHZU6Wdifvojet0s5oM5i6GyXb6s+8BaqspZdJdugYK33IzGI4h/FVYAkn5xjueAtNltnNxgQCp7X5OMCf//Z' />

      If run in non-sandbox mode this is correctly displayed as an image (checkmark on green circle).
      But in sandbox mode it shows as broken image (could not be loaded).

      When i first load this HTML no exception is logged. But if i right click on the image and choose "open in new window" then the following exception is triggered twice:

      java.security.AccessControlException: access denied ("java.net.NetPermission" "specifyStreamHandler")
      at java.security.AccessControlContext.checkPermission(Unknown Source)
      at java.security.AccessController.checkPermission(Unknown Source)
      at java.lang.SecurityManager.checkPermission(Unknown Source)
      at sun.plugin2.applet.AWTAppletSecurityManager.checkPermission(Unknown Source)
      at java.net.URL.checkSpecifyHandler(Unknown Source)
      at java.net.URL.<init>(Unknown Source)
      at com.sun.webkit.network.URLs.newURL(Unknown Source)
      at com.sun.webkit.network.URLs.newURL(Unknown Source)
      at com.sun.webkit.network.NetworkContext.canHandleURL(Unknown Source)
      at com.sun.webkit.ContextMenu.twkHandleItemSelected(Native Method)
      at com.sun.webkit.ContextMenu.access$000(Unknown Source)
      at com.sun.webkit.ContextMenu$ShowContext.notifyItemSelected(Unknown Source)
      at com.sun.javafx.webkit.theme.ContextMenuImpl.lambda$show$77(Unknown Source)
      at com.sun.javafx.webkit.theme.ContextMenuImpl$$Lambda$173/21567976.handle(Unknown Source)
      at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(Unknown Source)
      at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
      at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
      at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(Unknown Source)
      at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
      at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
      at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
      at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
      at com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source)
      at com.sun.javafx.event.EventUtil.fireEvent(Unknown Source)
      at javafx.event.Event.fireEvent(Unknown Source)
      at javafx.scene.control.MenuItem.fire(Unknown Source)
      at com.sun.javafx.scene.control.skin.ContextMenuContent$MenuItemContainer.doSelect(Unknown Source)
      at com.sun.javafx.scene.control.skin.ContextMenuContent$MenuItemContainer.lambda$createChildren$324(Unknown Source)
      at com.sun.javafx.scene.control.skin.ContextMenuContent$MenuItemContainer$$Lambda$189/27816829.handle(Unknown Source)
      at com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(Unknown Source)
      at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(Unknown Source)
      at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
      at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
      at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(Unknown Source)
      at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
      at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
      at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
      at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
      at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
      at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
      at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
      at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
      at com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source)
      at com.sun.javafx.event.EventUtil.fireEvent(Unknown Source)
      at javafx.event.Event.fireEvent(Unknown Source)
      at javafx.scene.Scene$MouseHandler.process(Unknown Source)
      at javafx.scene.Scene$MouseHandler.access$1500(Unknown Source)
      at javafx.scene.Scene.impl_processMouseEvent(Unknown Source)
      at javafx.scene.Scene$ScenePeerListener.mouseEvent(Unknown Source)
      at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(Unknown Source)
      at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(Unknown Source)
      at com.sun.glass.ui.View.handleMouseEvent(Unknown Source)
      at com.sun.glass.ui.View.notifyMouse(Unknown Source)
      at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
      at com.sun.glass.ui.win.WinApplication.lambda$null$141(Unknown Source)
      at com.sun.glass.ui.win.WinApplication$$Lambda$53/7629379.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)


      Maybe this also can be fixed with a doPrivileged() block?

      Attachments

        Activity

          People

            ant Anton Tarasov (Inactive)
            fleitenbejfx Frederic Leitenberger (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported: