-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[ErrorRenderer] Security fix: hide sensitive error messages #34158
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Absolutely agree with these changes! |
yceruto
approved these changes
Oct 28, 2019
ca4e97f
to
d7d7f22
Compare
Thank you @dunglas. |
yceruto
added a commit
that referenced
this pull request
Oct 28, 2019
…s (dunglas) This PR was merged into the 4.4 branch. Discussion ---------- [ErrorRenderer] Security fix: hide sensitive error messages | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | n/a | License | MIT | Doc PR | n/a This PR fixes a security issue. Exception messages must not be displayed except when debugging, because they can contain sensitive data including credentials. For instance, PDO and Doctrine throw exception with message such as `The details are: SQLSTATE[HY000] [1045] Access denied for user 'root'@'db.example.com' (using password: NO)` revealing internal details about the infrastructure usful for an attacker. Also, I still think that ErrorRenderer should be removed in favor of using the Serializer directly (see #33650 (comment)). I'll try to open some PRs to do that in tomorrow. Commits ------- d7d7f22 [ErrorRenderer] Security fix: hide sensitive error messages
Showing the exception message should be based on the status code. 4xx error are client errors which are meant for clients. So not showing the error message would make it useless. |
fabpot
added a commit
that referenced
this pull request
Nov 4, 2019
…yceruto) This PR was merged into the 4.4 branch. Discussion ---------- [ErrorRenderer] Show generic message in non-debug mode | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - I agree with @Tobion here #34158 (comment), so let's always show the detail message, but for 5xx errors we'll send a generic message instead. /cc @dunglas wdyt? Commits ------- 45f1a5e Show generic message in non-debug mode
symfony-splitter
pushed a commit
to symfony/security-bundle
that referenced
this pull request
Nov 4, 2019
…yceruto) This PR was merged into the 4.4 branch. Discussion ---------- [ErrorRenderer] Show generic message in non-debug mode | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - I agree with @Tobion here symfony/symfony#34158 (comment), so let's always show the detail message, but for 5xx errors we'll send a generic message instead. /cc @dunglas wdyt? Commits ------- 45f1a5ee06 Show generic message in non-debug mode
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes a security issue. Exception messages must not be displayed except when debugging, because they can contain sensitive data including credentials.
For instance, PDO and Doctrine throw exception with message such as
The details are: SQLSTATE[HY000] [1045] Access denied for user 'root'@'db.example.com' (using password: NO)
revealing internal details about the infrastructure usful for an attacker.Also, I still think that ErrorRenderer should be removed in favor of using the Serializer directly (see #33650 (comment)). I'll try to open some PRs to do that in tomorrow.