Skip to content
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

Cross-Site Scripting: Reflected #1110

Closed
QiAnXinCodeSafe opened this issue Jul 27, 2020 · 1 comment · Fixed by #1128
Closed

Cross-Site Scripting: Reflected #1110

QiAnXinCodeSafe opened this issue Jul 27, 2020 · 1 comment · Fixed by #1128
Assignees

Comments

@QiAnXinCodeSafe
Copy link

code = request.getParameter(Constants.CODE);
// handle the error response described at
// https://docs.microsoft.com/en-us/azure/active-directory/develop/v1-protocols-oauth-code#error-response
errorDescription = request.getParameter(Constants.ERROR_DESCRIPTION);
error = request.getParameter(Constants.ERROR);
final boolean isSuccess = StringUtils.isEmpty(error) && StringUtils.isNotEmpty(code);
response.setStatus(HttpServletResponse.SC_OK);
response.setContentType(Constants.CONTENT_TYPE_TEXT_HTML);
try (final PrintWriter writer = response.getWriter()) {
writer.write(isSuccess ? loginSuccessHTMLTemplate : String.format(loginErrorHTMLTemplate, error, errorDescription));

Sending unvalidated data to a web browser can result in the browser executing malicious code.

@wangmingliang-ms
Copy link
Contributor

the error and errorDescription come from Azure's own OAuth server, which should be trustable.

wangmingliang-ms added a commit that referenced this issue Aug 19, 2020
use guava's htmlescaper instead.
wangmingliang-ms added a commit that referenced this issue Aug 19, 2020
@wangmingliang-ms wangmingliang-ms self-assigned this Aug 19, 2020
wangmingliang-ms added a commit that referenced this issue Aug 25, 2020
wangmingliang-ms added a commit that referenced this issue Aug 25, 2020
* [github]#1110: XSS issues in azure-auth-helper
use guava's htmlescaper.
* [github #1110][devops #1764036]: update version of `azure-auth-helper` in depender
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants