Description
New Feature / Enhancement Checklist
- I am not disclosing a vulnerability.
- I am not just asking a question.
- I have searched through existing issues.
Current Limitation
(I think we discussed this issue already somewhere, but can't find where)
It is currently possible to download a file without being authenticated. Downloading a file should have similar restrictions to uploading a file. For example, it should be configurable that a file download is only available to authenticated users.
As long as file download is enabled for public (without auth required), a service could be misused as a file hosting service. For example, a user can create an account, upload a file as authenticated user, and then distribute the file download URL freely in public forums. Anyone would then be able to download the file. While it would be technically still possible to do that even if file download is restricted to authenticated users, it wouldn't be as easy as it is now.
Related:
- FR: ACL for Parse.File #7001
- beforeGetFile trigger #6572
- feat: add
Parse.Cloud.afterFind(Parse.File)
#7927
Feature / Enhancement Description
Add new Parse Server config options (similar to the file upload options) to restrict file download to:
- public
- anonymous user
- authenticated user
For example:
fileDownload: {
enableForPublic: false,
enableForAnonymousUser: false,
enableForAuthenticatedUser: true,
},
Limitation: If the Parse Server file adapter is configured to send a direct URL (e.g. to the AWS S3 resource), then the developer has to implement their own mechanism to prevent that (e.g. via expiring download links which is already supported in the Parse Server S3 file adapter).
Example Use Case
n/a
Alternatives / Workarounds
Unknown whether there is a current workaround for that, maybe via triggers?