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

Security question: how to validate the download url #220

Open
sebakerckhof opened this issue May 11, 2017 · 1 comment
Open

Security question: how to validate the download url #220

sebakerckhof opened this issue May 11, 2017 · 1 comment

Comments

@sebakerckhof
Copy link

I like the idea of uploading directly to the storage service instead of the data passing through my server.

However, this way, we have to give control to the user to tell us what the download url actually is.
E.g. from the readme:

var uploader = new Slingshot.Upload("myFileUploads");

uploader.send(document.getElementById('input').files[0], function (error, downloadUrl) {
  if (error) {
    // Log service detailed response.
    console.error('Error uploading', uploader.xhr.response);
    alert (error);
  }
  else {
    Meteor.users.update(Meteor.userId(), {$push: {"profile.files": downloadUrl}});
  }
});

So the user could enter any URL, even if what is at that URL does not abide by our validation rules for the directive. Which, depending on what you do with the resulting url, might be dangerous.

Is there any way for example to let S3 ping our server when an upload is done, by incorporating a 'notify-on-upload-complete url' in the directive (just making something up here) ?

@KaitaniLabs
Copy link

It looks like you can setup event notifications on your S3 bucket to ping to all kinds of places including email, sms and an HTTP endpoint.
screen shot 2017-09-29 at 14 27 00

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

No branches or pull requests

2 participants