Skip to content
Console

Request limits for presigned URLs

Presigned URLs in traditional object storage services (Tencent COS, Alibaba Cloud OSS, AWS S3) can only be limited by time, not by number of uses, which significantly weakens the security of object storage.

Bitiful S4 lets you limit the number of requests for presigned GetObject and PutObject URLs.

How to use it

When generating a presigned URL, add the x-bitiful-max-requests=10 parameter (replace 10 with the number of requests you want to allow).

On the 11th request, the system returns a 403 ReachTheMaxRequests error.

Security recommendation

When presigning a PutObject request, keep the expiration short (for example, 10 minutes) and set the maximum number of requests to 1. This helps prevent replay of presigned PutObject URLs.

Reference implementation

Bitiful has open-sourced a stateless presigned URL generation service that supports a range of security parameters and unique performance features.

ParameterTypeRequiredDefaultDescriptionApplies to
keyStringYes-The object's key/path, which identifies the object in the S3 bucketPUT & GET
content-lengthIntNoUnlimitedLength of the uploaded content in bytes; must be greater than 0 and no more than 1 GB (1024 MB)PUT
no-waitIntNo0Wait timeout in seconds for the "receive-as-you-upload" feature; maximum 10 secondsGET
max-requestsIntNo0Maximum download count: the maximum number of times the URL can be accessedPUT & GET
expireIntNo3600URL validity period in seconds; defaults to 1 hourPUT & GET
force-downloadBoolNofalseWhether to force a download (when set to true, an attachment response header is added)GET
limit-rateIntNo0Per-connection rate limit (bytes/second)GET

GitHub: https://github.com/bitiful/s3-presigned-api-server

Integrations

Bitiful Send, an open-source project from Bitiful, makes good use of this feature.

Demo: https://send.bitiful.com/ Source code: https://github.com/bitiful/send