-
Notifications
You must be signed in to change notification settings - Fork 203
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
EZP-31298: Made non verbose exception messages in REST responses #2945
Conversation
7cbdd56
to
6d03f46
Compare
6d03f46
to
6f8247a
Compare
eZ/Publish/Core/REST/Server/Tests/Output/ValueObjectVisitor/ExceptionTest.php
Outdated
Show resolved
Hide resolved
eZ/Publish/Core/REST/Server/Tests/Output/ValueObjectVisitor/ExceptionTest.php
Outdated
Show resolved
Hide resolved
eZ/Publish/Core/REST/Server/Tests/Output/ValueObjectVisitor/ExceptionTest.php
Show resolved
Hide resolved
6f8247a
to
7432882
Compare
251832a
to
7918dae
Compare
Added one small change - it will use proper error message for all "safe" errors like unauthorized, not found etc. Technical errors (>=500) are using generic "an error occured" message when not in debug mode. ping @micszo ready for a retest |
Do you have samples of what the "safe" errors look like now? The 4xx errors are interesting, do they give you any details other than for example HTTP 401 Unauthorised? |
400:
401:
403:
another 401:
|
Yes, these are all 4xx errors so they will be displayed as usual. We only hide 5xx messages i.e. type errors which are prone to leaking file paths. |
Thanks. The 400 error from the XML parser could be useful to someone trying an XML hack, such as XXE, or otherwise looking for exploitable bugs in our XML parser. Then again, that parser is open source. But if errors originating in the underlying libxml can be exposed indirectly, that's not good. I'd still say it's a little safer to give nothing away but a hashed and time-variable error code, which can be looked up in the logs by legit devs. But that is more dev work to make, and more cumbersome to work with if implemented. So I'd say this is ok, the most important problem is fixed. |
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.
In symfony env prod
error descriptions for 500 error messages are now masked with the phrase "An error has occurred. Please try again later or contact your Administrator.".
QA Approved on eZ Platform EE v2.5.8 with diff.
Could you merge it up? |
…ages in REST responses"
7.5
This PR hides potentially sensitive data that could be leaked on REST exceptions.
TODO:
$ composer fix-cs
).