From efebac131acdf38d6af54d21bdf4cf88fd11e824 Mon Sep 17 00:00:00 2001 From: Kayathiri Mahendrakumaran Date: Tue, 24 Sep 2024 17:01:03 +0530 Subject: [PATCH] Fix username unescaping in challenge question flow --- .../src/main/webapp/challenge-question-request.jsp | 3 +++ .../apps/recovery-portal/src/main/webapp/recovery.jsp | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/identity-apps-core/apps/recovery-portal/src/main/webapp/challenge-question-request.jsp b/identity-apps-core/apps/recovery-portal/src/main/webapp/challenge-question-request.jsp index 17152bb1093..442f42c0e30 100644 --- a/identity-apps-core/apps/recovery-portal/src/main/webapp/challenge-question-request.jsp +++ b/identity-apps-core/apps/recovery-portal/src/main/webapp/challenge-question-request.jsp @@ -35,6 +35,9 @@ <% String username = IdentityManagementEndpointUtil.getStringValue(request.getAttribute("username")); + if (StringUtils.isNotBlank(username)) { + username = StringEscapeUtils.unescapeJava(username); + } RetryError errorResponse = (RetryError) request.getAttribute("errorResponse"); if (errorResponse != null) { diff --git a/identity-apps-core/apps/recovery-portal/src/main/webapp/recovery.jsp b/identity-apps-core/apps/recovery-portal/src/main/webapp/recovery.jsp index 785814cdcc5..d0fd508e4d2 100644 --- a/identity-apps-core/apps/recovery-portal/src/main/webapp/recovery.jsp +++ b/identity-apps-core/apps/recovery-portal/src/main/webapp/recovery.jsp @@ -80,7 +80,6 @@ if (StringUtils.isNotBlank(username)) { username = (String) request.getAttribute("resolvedUsername"); - username = StringEscapeUtils.unescapeJava(username); } // Password recovery parameters