Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clearly advise how to protect uploaded files #927

Closed
brynwhyman opened this issue Jan 13, 2020 · 4 comments
Closed

Clearly advise how to protect uploaded files #927

brynwhyman opened this issue Jan 13, 2020 · 4 comments

Comments

@brynwhyman
Copy link

brynwhyman commented Jan 13, 2020

Overview

A userform can be built to include a file upload field. At the top of this field edit form, there's the message Files uploaded through this field could be publicly accessible if the exact URL is known, but the user isn't instructed on how to avoid this.

By not taking further action, it's possible that a CMS user could be exposing files from their website visitors for anyone to access, through:

  • Search engine indexing, unless there's specific exclusions through things like robots.txt files
  • Malicious website visitors fuzzing site URLs for expected file paths

It's relatively easy to ensure that uploaded files are protected:

  1. Create a folder in the Files are and set the 'Who can view this file?' permission to 'Logged-in users'
  2. When adding the File Upload Field to a userform, set the upload folder to be the one created in step 1.

However, this requires prior understanding of protected assets. I'm wondering whether there is a nice UX flow that could be built within userforms to make this more intuitive.

User story

As a CMS user creating a userform, I want to set all uploads made through a File Upload Field to be protected from anonymous users, so that I can ensure potential private information is safe from malicious use.

brynwhyman pushed a commit to creative-commoners/silverstripe-userforms that referenced this issue Jan 31, 2020
Touching up the documentation for userforms to advise how uploaded files can be kept secure.

Related (but does not address) silverstripe#927
@chillu chillu mentioned this issue Feb 2, 2020
3 tasks
@chillu
Copy link
Member

chillu commented Feb 2, 2020

Actually, I'm advocating that we protect files by default - we shouldn't retain bad defaults like this - see #934

@brynwhyman
Copy link
Author

Yup, I'd agree protecting files should be a default.

@clarkepaul
Copy link

clarkepaul commented Jul 1, 2020

I think this might be covered @brynwhyman @chillu. Also, some additional user guide to help with this understanding has been created too.

Same goes for #934

@brynwhyman
Copy link
Author

Yup, definitely covered with the impending release of v5.3, specifically those mentioned in this comment. Closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants