You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2021/01/25 07:58:20 UTC

[GitHub] [cordova-ios] TinkerBuild opened a new issue #1063: Scrom File Can't Read SandBox

TinkerBuild opened a new issue #1063:
URL: https://github.com/apache/cordova-ios/issues/1063


   # Bug Report
   
   WebPageProxy::Ignoring request to load this main resource because it is outside the sandbox.  In real device
   
   ## Problem
   
   Can't read the file in cordova ios.
   
   ### What is expected to happen?
   
   
   
   ### What does actually happen?
   
   
   
   ## Information
   <!-- Include all relevant information that might help understand and reproduce the problem -->
   
   
   
   ### Command or Code
   <!-- What command or code is needed to reproduce the problem? -->
   
   
   
   ### Environment, Platform, Device
   <!-- In what environment, on what platform or on which device are you experiencing the issue? -->
   
   
   
   ### Version information
   <!-- 
   What are relevant versions you are using?
   For example:
   Cordova: Cordova CLI, Cordova Platforms, Cordova Plugins 
   Other Frameworks: Ionic Framework and CLI version
   Operating System, Android Studio, Xcode etc.
   -->
   
   
   
   ## Checklist
   <!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
   
   - [ ] I searched for existing GitHub issues
   - [ ] I updated all Cordova tooling to most recent version
   - [ ] I included all the necessary information above
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-ios] TinkerBuild commented on issue #1063: Can't Read Scrom File In IOS

Posted by GitBox <gi...@apache.org>.
TinkerBuild commented on issue #1063:
URL: https://github.com/apache/cordova-ios/issues/1063#issuecomment-766634120


   Error Log:
   2021-01-22 10:57:45.720099+0700 CQ Academy[398:22865] [Loading] Received an unexpected URL from the web process
   2021-01-22 10:57:45.720240+0700 CQ Academy[398:22865] [Process] 0x101838a18 - [pageProxyID=13, webPageID=14, PID=401] WebPageProxy::Ignoring request to load this main resource because it is outside the sandbox


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-ios] afioletov commented on issue #1063: Can't Read Scrom File In IOS

Posted by GitBox <gi...@apache.org>.
afioletov commented on issue #1063:
URL: https://github.com/apache/cordova-ios/issues/1063#issuecomment-892154007


   Hi @breautek, 
   
   We have similar issue and I created new bug with details: #1134 
   Are you sure that WKWebView disallows access to all files outside the bundle? Error says "outside the sandbox" and [data container it a part of sandbox:](https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/FileSystemOverview/FileSystemOverview.html)
   
   ![](https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/art/ios_app_layout_2x.png)
   
    


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-ios] breautek commented on issue #1063: Can't Read Scrom File In IOS

Posted by GitBox <gi...@apache.org>.
breautek commented on issue #1063:
URL: https://github.com/apache/cordova-ios/issues/1063#issuecomment-917796504


   I didn't know how to respond to your last remark but I finally got around the time of researching.
   
   It appears WebKit terminology of "Sandbox" does not mean the same thing as the iOS sandbox.
   
   First we can see where WebKit prints out the sandbox error in question [here](https://github.com/WebKit/WebKit/blob/592c83ba59dca6723df558e0938b8d9d6f7ab915/Source/WebKit/UIProcess/WebPageProxy.cpp#L5339), and it does so when `checkURLReceivedFromCurrentOrPreviousWebProcess` returns false.
   
   That [method](https://github.com/WebKit/WebKit/blob/592c83ba59dca6723df558e0938b8d9d6f7ab915/Source/WebKit/UIProcess/WebPageProxy.cpp#L10372) does a few different checks, but I believe the main reason why it doesn't work is because I believe `m_mayHaveUniversalFileReadSandboxExtension` is false.
   
   We know it doesn't enter any of the conditions and eventually reaches to [process.checkURLReceivedFromWebProcess(url);](https://github.com/WebKit/WebKit/blob/592c83ba59dca6723df558e0938b8d9d6f7ab915/Source/WebKit/UIProcess/WebPageProxy.cpp#L10384) because of your error message prints a couple lines before. This brings us to the [WebProcessProxy](https://github.com/WebKit/WebKit/blob/592c83ba59dca6723df558e0938b8d9d6f7ab915/Source/WebKit/UIProcess/WebProcessProxy.cpp#L747) class. Again, it does some further checks, but the interested one is the `m_mayHaveUniversalFileReadSandboxExtension` variable is falsy because we do see `"Received an unexpected URL from the web process"` being printed.
   
   So looking to see if/when that variable becomes truthy, that seems to be handled in [WebPageProxy::maybeInitializeSandboxExtensionHandle](https://github.com/WebKit/WebKit/blob/592c83ba59dca6723df558e0938b8d9d6f7ab915/Source/WebKit/UIProcess/WebPageProxy.cpp#L1249)
   
   In `maybeInitializeSandboxExtensionHandle`, we also see a lot of references of `resourceDirectoryURL`.
   
   From the [Appe Docs](https://developer.apple.com/documentation/foundation/nsbundle/1413058-pathsforresourcesoftype?language=objc)
   
   So I believe this is what instructs WKWebView that it is okay to load in content from the app bundle container, so I think the first half of `maybeInitializeSandboxExtensionHandle`.
   
   The second half of that method [here](https://github.com/WebKit/WebKit/blob/592c83ba59dca6723df558e0938b8d9d6f7ab915/Source/WebKit/UIProcess/WebPageProxy.cpp#L1305-L1314) is what needs to run successfully for WKWebVIew to grant access to loading content outside of the app bundle container. `willAcquireUniversalFileReadSandboxExtension` method is what sets `m_mayHaveUniversalFileReadSandboxExtension` to true.
   
   > In macOS, the top-level nonlocalized resource directory is typically called Resources but in iOS, it is the main bundle directory.
   
   I'm not an expert on the WebKit base at all, but based on the information available, I believe `if (auto handle = SandboxExtension::createHandle("/", SandboxExtension::Type::ReadOnly)) {` is returning a nullish/falsey value and the code is not entering the if condition, restricting access to outside of the app bundle.
   
   I don't know if there is a path to make it work, but I think this makes it clear that when WebKit talks about the sandbox, it isn't the same as the iOS sandbox architecture. It's talking about a broad sandbox (as this code is not strictly for iOS, it's used for mac as well).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-ios] breautek commented on issue #1063: Can't Read Scrom File In IOS

Posted by GitBox <gi...@apache.org>.
breautek commented on issue #1063:
URL: https://github.com/apache/cordova-ios/issues/1063#issuecomment-767998268


   Please fill in the form.
   
   How are you trying to load this resource? It sounds like you're trying to navigate the Cordova webview to a local file that is outside of your app's sandbox (ie outside of your app bundle), which the WKWebView disallows. 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-ios] TinkerBuild commented on issue #1063: Can't Read Scrom File In IOS

Posted by GitBox <gi...@apache.org>.
TinkerBuild commented on issue #1063:
URL: https://github.com/apache/cordova-ios/issues/1063#issuecomment-766634120


   Error Log:
   2021-01-22 10:57:45.720099+0700 CQ Academy[398:22865] [Loading] Received an unexpected URL from the web process
   2021-01-22 10:57:45.720240+0700 CQ Academy[398:22865] [Process] 0x101838a18 - [pageProxyID=13, webPageID=14, PID=401] WebPageProxy::Ignoring request to load this main resource because it is outside the sandbox


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org