W3C home > Mailing lists > Public > whatwg@whatwg.org > April 2017

Re: [whatwg] Accessing local files with JavaScript portably and securely

From: David Kendal <me@dpk.io>
Date: Sat, 15 Apr 2017 19:54:04 +0200
Message-Id: <93F05E44-68C9-4586-AF33-9FA4FE1294BE@dpk.io>
To: Roger Hågensen <rh_whatwg@skuldwyrm.no>
Cc: whatwg@lists.whatwg.org
On 15 Apr 2017, at 14:07, Roger Hågensen <rh_whatwg@skuldwyrm.no> wrote:

> Patrick makes a good point.
> 
> For example asking a user if it' sok for the HTML document to access 
> stuff in "C:\Users\Username\AppData\Local\Temp\" what do you think most 
> uses will do?
> Just click OK, after all "they" have nothing important in that folder, 
> their stuff is in "Documents" instead.

This is why I added the restriction that pages can only request access
to directories that are parents of the directory they're in. I admit I
don't actually know much about how Windows lays out files these days --
if the 'Downloads' folder is within some other folder that also contains
a load of private stuff. If so, or if that's so on some other popular
OS, maybe I'm wrong.

Browsers could also add restrictions that you can't request access to
the root directory or top-level subdirectory of an OS volume, or what-
ever else is needed for appropriate security on a particular OS.

Some participants on the Chrome bug thread suggested that Chrome could
look for some hidden file that would give files in the directory under
it XHR/Fetch access to that directory. That seems similar to what you
suggest, but I dislike the idea of a hidden file doing this unbeknownst
to users -- and even if it were visible, its function may not be obvious.

-- 
dpk (David P. Kendal) · Nassauische Str. 36, 10717 DE · http://dpk.io/
    Gott schütze mich vor Staub und Schmutz,           +49 159 03847809
      vor Feuer, Krieg und Denkmalschutz.
          — seen on an old building in Bamberg, Bavaria
Received on Saturday, 15 April 2017 17:54:39 UTC

This archive was generated by hypermail 2.3.1 : Saturday, 15 April 2017 17:54:39 UTC