-
-
Notifications
You must be signed in to change notification settings - Fork 4k
CAS-1203: Allow login error messages to render HTML content #147
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
Conversation
|
If there's a chance an error can contain user provided data (i.e. username, etc.) then we should now allow this. It won't differentiate between the message template having HTML and the parameters, will it? |
|
If I understand your question correctly, the message that is displayed is statically always retrieved from the bundle and it does not include any dynamic parameters. That only "dynamic" thing that affects that is the exception indicating the message code:
So, it does not differentiate between parameters (such as that of the form's) and html code, but there are no parameters unless the above line is modified by an adopter to pass in various parameters and args when building that message. So, it seems to me that this is not violating any security principals, but if someone chooses to modify the error to actually display sensitive data, then the onus is on them. Does that make sense? |
|
I am going to further look into this and see if what Scott suggests can be duplicated. I'll report back in a little bit. |
…r default message codes to be displayed instead of the actual exception message.
|
I reviewed and tested the original changeset with a mocked exception throw that returned sensitive data in its message. What I realized was, the default text that is displayed in case no code is found by the In the next pull, this is what I have done:
|
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.
Javadoc is required on class header...
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.
Good point. Will do.
|
So, are you saying that instead of using |
|
Sorry if I wasn't clear : the usage of |
|
I would like to underscore Scott's concern. We got dinged on a security review of one of our internal apps for a case exactly like this: we had not considered that parameterized error messages could contain content provided by the user, which created an XSS vector when rendered as HTML to the client. |
|
I understand. I think this pull, in the way that it reorganizes the exception hierarchy and in particular, the way it re purposes |
|
I have updated the default text message which may be displayed back to the client in case |
|
+1 |
|
Planning to merge this one by EOD, unless there are other concerns around the pull. |
Conflicts: cas-server-webapp/src/main/webapp/WEB-INF/view/jsp/default/ui/casLoginView.jsp
CAS-1203: Allow login error messages to render HTML content
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
https://issues.jasig.org/browse/CAS-1203