Skip to content

Commit bea04a4

Browse files
committed
fix(security): enforce ContentLengthRange in presigned upload URLs
1 parent 7f35174 commit bea04a4

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎app/Http/Controllers/ResourceController.php‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,10 @@ public function generateUploadUrl(Request $request)
215215
$signed = Storage::disk('s3')->temporaryUploadUrl(
216216
$key,
217217
now()->addMinutes(15),
218-
['ContentType' => $fileData['content_type']]
218+
[
219+
'ContentType' => $fileData['content_type'],
220+
'ContentLengthRange' => [1, $fileData['size']],
221+
]
219222
);
220223

221224
$results[] = [

0 commit comments

Comments
 (0)