Skip to content
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

$_SERVER should not have .env file info #3615

Closed
nyufeng opened this issue Sep 7, 2020 · 3 comments
Closed

$_SERVER should not have .env file info #3615

nyufeng opened this issue Sep 7, 2020 · 3 comments

Comments

@nyufeng
Copy link
Contributor

nyufeng commented Sep 7, 2020

if (empty($_SERVER[$name]))
{
$_SERVER[$name] = $value;
}

Usually, we set the database password in the .env file, the security encryption string.
If $_SERVER have this info. It will become unsafe.
If the programmer forgets to delete the debugging information, the information will be exposed.

example:
image

@michalsn
Copy link
Member

michalsn commented Sep 7, 2020

I'm not sure if I'm following - do we store $_SERVER variables somewhere automatically? What debugging options do you have in mind?

@nyufeng
Copy link
Contributor Author

nyufeng commented Sep 8, 2020

@michalsn
I mean, $_SERVER should not contain .env information.
.env often contains sensitive information.
If the system has some vulnerabilities, only need to print $_SERVER, important information such as database password will be exposed.

@michalsn
Copy link
Member

michalsn commented Sep 8, 2020

These are environment variables so they should be set to $_SERVER too. If we stop setting these variables into $_SERVER it will introduce a BC change. Also, I don't really understand what type of vulnerabilities you're talking about.

Debugging with helper functions such as d() or dd() doesn't work in production. So if you somehow forgot to remove this type of call from your code, you will still be safe.

@nyufeng nyufeng closed this as completed Sep 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants