-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Don't leak env values into $_SERVER
#598
Conversation
4bf21d7
to
c68c908
Compare
config/application.php
Outdated
$dotenv = Dotenv\Dotenv::createUnsafeImmutable($root_dir, ['.env', '.env.local'], false); | ||
$repository = Dotenv\Repository\RepositoryBuilder::createWithNoAdapters() | ||
->addAdapter(Dotenv\Repository\Adapter\EnvConstAdapter::class) | ||
->addAdapter(Dotenv\Repository\Adapter\PutenvAdapter::class) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@QWp6t needed this as well to mirror the default behaviour and get everything working
Is this still necessary to fix #474? |
@montchr I think so! Thanks for the bump, I think this just got forgotten about 😅 will get this rebased and hopefully reviewed soon cc @QWp6t @tangrufus |
Given that this package doesn't have an upgrade path because it's a boilerplate, I wouldn't worry about breaking changes |
merge? |
c68c908
to
e24bb46
Compare
$_SERVER
Updates to using a custom repository for `Dotenv` instead of the default which includes `ServerConstAdapter`. The new custom repository *only* includes `EnvConstAdapter`. The `$_SERVER` superglobal often gets dumped into logs or into monitoring services so it's better for security to avoid populating it with secrets contained in `.env`. Co-authored-by: Ben Word <[email protected]>
e24bb46
to
4f77694
Compare
Updates to using a custom repository for
Dotenv
instead of the default which includesServerConstAdapter
.The new custom repository only includes
EnvConstAdapter
.The
$_SERVER
superglobal often gets dumped into logs or into monitoring services so it's better for security to avoid populating it with secrets contained in.env
.Note: this could be a breaking change for some users, but we at least need to ensure it's not breaking in the normal case.
Close #474