Question

How to secure a signed url for uploading to spaces.

In my backend I create a signed url that the client uses for uploading directly to the storage.

I setup content-type and content-length by validating the request, but such parameters are then ignored when proceeding with the upload to the storage. I tried generating the url with one file then switching file and the upload still works fine.

I am worried of security issues with someone using a signed url to upload thousands of files or very large files. How likely is this to happen?

Thanks for your help!


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

alexdo
Site Moderator
Site Moderator badge
January 22, 2024

Heya, @50e0782ec2a94d689f2ac4589feb74

Pre-signed URLs only offer temporary access for unauthorized users and eventually expire.

When generating a pre-signed URL, you can set the following parameters:

  • Bucket – bucket containing or will be containing the object
  • Key – object’s name
  • Expires – amount of time the URL is valid

You can ensure that the signed URLs have a limited expiration time. By setting a short expiration time, you reduce the window of opportunity for malicious activities.

Hope that this helps!

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel