← PHP / Laravel · Contents

PHP-058 / Intermediate

Resource exhaustion through APIs without rate limits (DoS)

A04:2021 Insecure Design · CWE-770 Allocation of Resources Without Limits

Why is this a problem?

Unlimited requests exhaust database, email and external API budgets and availability.

How to fix it

php
Route::post('/sms/send', SmsCtrl::class)->middleware('throttle:10,1');

Further reading