Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-5960

File API mishandles relative URLs that traverse directories above the FS root

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • None
    • None

    Description

      Filesystem URLs should not be able to use ".." path components to reach outside of their sandbox. From the File API, ".." relative to a path resolves to the paths parent directory, and the parent directory of the filesystem root is itself.

      So, if root is a DirectoryEntry representing the root of a filesystem, then

      root.getFile("../file.txt", ...);
      

      and

      root.getFile("/file.txt", ...);
      

      should resolve to the same file.

      root.getDirectory("subdir_a/subdir_b", function(entry) {
          entry.getFile("../file.txt", ...);
      }, ...);
      

      should resolve to "/subdir_a/file.txt"

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              iclelland Ian Clelland
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: