oracle / cordova-plugin-wkwebview-file-xhr

Cordova Plugin for WebView File XHR
Universal Permissive License v1.0
138 stars 120 forks source link

cordova /Library/NoCloud/ and /Library/files #27

Closed marc0n3 closed 5 years ago

marc0n3 commented 5 years ago

I see the plugin is limited to www. Should it not be limited to the whole app directories that are user writable?

Is there a way I can use it to read those files?

Thanks in advance

gvanmat commented 5 years ago

No, the intention is not to provide greater access outside the protection of the readonly application bundle. Access outside the www folder defining the document root would open up to a directory traversal attack.

marc0n3 commented 5 years ago

Thank you, I'll try other ways.

Best regards, Marco

On ott 5 2018, at 5:55 pm, Gary Van Matre notifications@github.com wrote:

No, the intention is not to provide greater access outside the protection of the readonly application bundle. Access outside the www folder defining the document root would open up to a directory traversal attack. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub (https://link.getmailspring.com/link/1538755196.local-eaa73abc-1569-v1.4.2-f587b7b7@getmailspring.com/0?redirect=https%3A%2F%2Fgithub.com%2Foracle%2Fcordova-plugin-wkwebview-file-xhr%2Fissues%2F27%23issuecomment-427413955&recipient=cmVwbHkrMDBjNDAzN2Y1ZDEyODk0M2E3ZmJkMjI3MzMxY2FiNmFhZTc1M2YwNzY4NDU5NjQ3OTJjZjAwMDAwMDAxMTdjZjRiODI5MmExNjljZTE1ZTNmNjY5QHJlcGx5LmdpdGh1Yi5jb20%3D), or mute the thread (https://link.getmailspring.com/link/1538755196.local-eaa73abc-1569-v1.4.2-f587b7b7@getmailspring.com/1?redirect=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAMQDf_B1ylB-yFnt2wQJ7QpnwmNnEktgks5uh4ECgaJpZM4XKcx4&recipient=cmVwbHkrMDBjNDAzN2Y1ZDEyODk0M2E3ZmJkMjI3MzMxY2FiNmFhZTc1M2YwNzY4NDU5NjQ3OTJjZjAwMDAwMDAxMTdjZjRiODI5MmExNjljZTE1ZTNmNjY5QHJlcGx5LmdpdGh1Yi5jb20%3D).

gvanmat commented 5 years ago

@marc0n3 You might look at using the file plugin.

marc0n3 commented 5 years ago

Sorry, one more thing. Actually, in cordova, I've access to dataDirectory, syncedDataDirectory, cacheDirectory, that resides in the Library folder of the app. Why can't i read a file that I've stored in dataDirectory, for example an image? Actually I've access to these file using cordova-file plugin, but on android I still can call the file using the path. I don't understand why the same thing is not possible under WkWebView using your plugin by allowing access to the list of dir listed here: https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-file/#ios-file-system-layout I'm looking at a way to load the data from XHR because I've a proprietary solution similar to CodePush that load my application in file:///var/mobile/Containers/Data/Applocation/XXXXXXXXXXXXX/Library/files/ and stores user generated files in file:///var/mobile/Containers/Data/Applocation/XXXXXXXXXXXXX/Library/NoCloud Apple Store is not my concern because I release inHouse, so there are any other security issue you see if i enable those dirs by forking your plugin?

gvanmat commented 5 years ago

@marc0n3 It is possible but not the purpose of this plugin. The cordova file pluign already provides read and write access to the applications file systems across platforms.

cquezpro commented 5 years ago

@marc0n3 Did you solve problem? because I got same issue now permission-error-3 permission-error-load-file

marc0n3 commented 5 years ago

@sirius2013 I've abandoned the search! There were too many issues in the loading process we've done and we opted for a "local server on the phone" solution. Good luck!

sajallimbu commented 4 years ago

@marc0n3 Did you solve problem? because I got same issue now permission-error-3 permission-error-load-file

Did you find a solution to this? I've been trying to solve this and have looked for some work arounds but i really dont want to copy files in temp or opt for a "local server on the phone" solution.

marc0n3 commented 4 years ago

@sajallimbu Sorry, but no. I've abandoned the task