← PHP / Laravel · Contents

PHP-077 / Advanced

Artisan, Tinker or debug commands accessible in production

A05:2021 Security Misconfiguration · CWE-489 Active Debug Code

Why is this a problem?

Data can be manipulated if debug routes or commands are enabled in production.

How to fix it

php
if (app()->environment('local')) { Route::get('/debug/...', ...); }  // Do not register in production

Further reading