-
Notifications
You must be signed in to change notification settings - Fork 11.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dot-env variables easily exposed #18492
Comments
What's the issue? |
The former. Database password must not be shown in debug error or whatever. The latter sounds developer driven as usual. Ps.: about the nº 1, is it all related to APP_DEBUG variable and just? Is that my blame? Sorry. |
Your description of 1 seems like a leak in the debug backtrace. So, yeah, you shouldn't be running production with Still don't understand why you care about 2, though. |
Nice. IMO, all the world has warned us about the "globals". So I couldn't call the variable globally ($_SERVER["DB_DATABASE"]), but through its own object (env function) and just. It's the purpose, isn't? Thanks. |
In fact, I see no code bug. Maybe some security tips are needed for understanding. |
You must
|
since |
@bappy004 Switch to Laravel. |
Hi @sisve thanks for the suggestion. However, switching to Laravel seems a bit extreme just to mitigate this dotEnv potential issue. Any other suggestions? |
@bappy004 Avoid using the .env file. Instead, modify the configuration files directly. The root cause is that dotenv will set entries in $_SERVER, and the only way to avoid it is to avoid using dotenv, and thus the .env file. |
This can't be true... When you accidently forget to set APP_DEBUG to false That's just enough convincing for website owners to ditch Laravel and go for one of the like 200 other MVC frameworks (think of codeigniter, symphony itself, yii, CakePHP, and so on, and so on) Why don't you just remove the .env variables from the Whoops page by default (and yeah, entirely)? Problem solved? |
This is like forgetting your FTP on public/anonymous access mode and then yelling at a developer like WHY DON'T YOU JUST REMOVE ALL PHP FILES FROM FTP TO KEEP US SECURE? @PieterjanDeClippel just delete your files, that will keep you far from security risks in being a website/webapp owner. |
The security concern here, is using debug mode in production. |
This comment has been minimized.
This comment has been minimized.
Well shame on you by leaving |
@PieterjanDeClippel please refrain from name calling and be polite to other developers. Going to lock this thread down as this has gone off topic too much. |
Description:
Time ago, a Laravel's error exposed my database credential. (Yes, I refer about those erros with "thrown exceptions" while APP_DEBUG is true).
Now, my Lumen has DB_PASSWORD at $_SERVER in.
So... how do I avoid these security issues? Should dot-env variables be there?
Thanks in advance.
Steps To Reproduce:
dd($_SERVER)
The text was updated successfully, but these errors were encountered: