Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[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
merged 1 commit into from
Oct 28, 2019

Conversation

dunglas
Copy link
Member

@dunglas dunglas commented Oct 28, 2019

Q A
Branch? 4.4
Bug fix? yes
New feature? no
Deprecations? no
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.

@yceruto
Copy link
Member

yceruto commented Oct 28, 2019

Absolutely agree with these changes!

@yceruto yceruto added this to the 4.4 milestone Oct 28, 2019
@yceruto yceruto force-pushed the error-renderer-security branch from ca4e97f to d7d7f22 Compare October 28, 2019 23:42
@yceruto
Copy link
Member

yceruto commented Oct 28, 2019

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
@yceruto yceruto merged commit d7d7f22 into symfony:4.4 Oct 28, 2019
@Tobion
Copy link
Contributor

Tobion commented Oct 31, 2019

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.

@yceruto
Copy link
Member

yceruto commented Oct 31, 2019

@Tobion I addressed your comment in #34197.

@dunglas dunglas deleted the error-renderer-security branch October 31, 2019 09:45
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.