Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

kleand's avatar

Debug mode security issue

I think and strongly believe that laravel shouldn't expose environment variables in debug mode.

What happened to me recently is:

I setup a staging environment where other team members should be able to test and work but some online bots captured this instance in debug mode and exploited my third party service credentials such as SMTP provider.

I see no reason why should this mode expose .env at all.

0 likes
3 replies
kleand's avatar

@tykus I totally understand you, but what's missing from the framework is a mode which can be online so that teams can use it to QA,TEST and reproduce any errors and not expose any credentials in the same time.

tykus's avatar

what's missing from the framework is a mode which can be online so that teams can use it to QA,TEST and reproduce any errors

That is not debugging.

Use a bug tracking tool like Sentry, Bugsnag etc. if the staging site must be publically accessible, otherwise, password-protect the staging site, or use the maintenance mode secret.

Please or to participate in this conversation.