#580: Limit allowed "accepted" extensions in File System Access API file pickers.

Visit on Github.

Opened Dec 2, 2020

HIQaH! QaH! TAG!

I'm requesting a TAG review of a small tweak to the File System Access API.

Initially the File System Access API (previously known as Native File System API) had no limitations on what strings were allowed to be used as accepted file extensions in the showOpenFilePicker and showSaveFilePicker methods.

Since the file picker (on most platforms) appends these extensions to the filename the user enters, this can result in filenames with characters we don’t want to allow/that are otherwise problematic. In particular we don't want to allow control characters or whitespace in suffixes, or filenames that end in a '.'. As such we add restrictions on what characters are allowed in accepts file extensions/suffixes, as well as limiting their length to 16.

Limiting extensions to only contain alphanumeric characters, + or . still allows all extensions in the shared-mime-info database as well as nearly all extensions in Wikipedia's List of filename extensions.

Further details:

  • I have reviewed the TAG's API Design Principles
  • Relevant time constraints or deadlines: As this fixes potential security issues we will be shipping these changes as soon as possible. We will try to address any feedback that comes in afterwards.
  • The group where the work on this specification is currently being done: WICG
  • The group where standardization of this work is intended to be done (if current group is a community group or other incubation venue): WebAppsWG
  • Major unresolved issues with or opposition to this specification:
  • This work is being funded by: Google

You should also know that...

[please tell us anything you think is relevant to this review]

We'd prefer the TAG provide feedback as (please delete all but the desired option):

💬 leave review feedback as a comment in this issue and @-notify @mkruisselbrink

Discussions

2021-01-Kronos

Minutes

Looks sensible, but none of us have ever see .c++ file extension

2021-03-15

Minutes

Ken: no feedback. About what file extensions you can use, they added .c++ ... if you're adding that you need .c# and others commonly in use that are weird, I researched and aded screenshots and we haven't heard anything back.

Dan: will ping Chris H about it. Re-review in plenary and see if there's anything new

2021-03-22

Minutes

Sangwhan: no response to our feedback

Dan: I'll ping the requester and Chris