This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a commit to branch coheigea/OIDC-management
in repository https://gitbox.apache.org/repos/asf/cxf-fediz.git

commit 4dc236b5293c1cca8265bfae6d747c791942418a
Author: Colm O hEigeartaigh <[email protected]>
AuthorDate: Tue Nov 24 13:14:37 2026 +0000

    Escape client-registration fields in the OIDC management console
---
 services/oidc/src/main/webapp/WEB-INF/views/client.jsp        |  8 ++++----
 services/oidc/src/main/webapp/WEB-INF/views/editClient.jsp    | 11 ++++++-----
 .../oidc/src/main/webapp/WEB-INF/views/registeredClients.jsp  |  2 +-
 3 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/services/oidc/src/main/webapp/WEB-INF/views/client.jsp 
b/services/oidc/src/main/webapp/WEB-INF/views/client.jsp
index 26cf4642..51cfef1a 100644
--- a/services/oidc/src/main/webapp/WEB-INF/views/client.jsp
+++ b/services/oidc/src/main/webapp/WEB-INF/views/client.jsp
@@ -78,7 +78,7 @@
         homeRealmAlias = "Default - User selection at login";
     }
 %> 
-    <%=  homeRealmAlias %>
+    <%= StringEscapeUtils.escapeHtml4(homeRealmAlias) %>
 </td>
 </tr>
 <tr>
@@ -89,7 +89,7 @@
 <% if (client.getRedirectUris() != null) {
                 for (String redirectURI : client.getRedirectUris()) {
                   %>
-           <%=    redirectURI %><br/>
+           <%= StringEscapeUtils.escapeHtml4(redirectURI) %><br/>
            <%   }
               } %>
 </td>
@@ -102,7 +102,7 @@
 <% if (client.getRegisteredAudiences() != null) {
                 for (String audURI : client.getRegisteredAudiences()) {
                   %>
-           <%=    audURI %><br/>
+           <%= StringEscapeUtils.escapeHtml4(audURI) %><br/>
            <%   }
               } %>
 </td>
@@ -113,7 +113,7 @@
 </td>
 <td>
 <% if (client.getProperties().get("post_logout_redirect_uris") != null) { %>
-           <%=    client.getProperties().get("post_logout_redirect_uris") %>
+           <%= 
StringEscapeUtils.escapeHtml4(client.getProperties().get("post_logout_redirect_uris"))
 %>
 <% } %>
 </td>
 </tr>
diff --git a/services/oidc/src/main/webapp/WEB-INF/views/editClient.jsp 
b/services/oidc/src/main/webapp/WEB-INF/views/editClient.jsp
index 403dd7b5..6968d3f5 100644
--- a/services/oidc/src/main/webapp/WEB-INF/views/editClient.jsp
+++ b/services/oidc/src/main/webapp/WEB-INF/views/editClient.jsp
@@ -1,6 +1,7 @@
 <%@ page
        import="javax.servlet.http.HttpServletRequest, java.util.Map, 
org.apache.cxf.fediz.service.oidc.clients.EditClient,
-        org.apache.cxf.rs.security.oauth2.common.Client, 
org.apache.cxf.fediz.service.oidc.CSRFUtils"
+        org.apache.cxf.rs.security.oauth2.common.Client, 
org.apache.cxf.fediz.service.oidc.CSRFUtils,
+        org.apache.commons.text.StringEscapeUtils"
 %>
 <%
     EditClient editClient = (EditClient)request.getAttribute("data");
@@ -26,7 +27,7 @@
                        </div>
                        <div class="form-line">
                                <label for="client_name" id="label_name" 
class="form-label"> Name </label>
-                               <input placeholder="OIDC Client Name" 
type="text" value="<%=c.getApplicationName()%>"
+                               <input placeholder="OIDC Client Name" 
type="text" value="<%= StringEscapeUtils.escapeHtml4(c.getApplicationName()) %>"
                                        size="40" name="client_name" 
id="input_name" data-type="input-textbox" />
                        </div>
                        <div class="form-line">
@@ -37,19 +38,19 @@
                        </div>
                        <div class="form-line">
                                <label for="client_redirectURI" 
id="label_redirect" class="form-label"> Redirect URL </label>
-                               <input type="text" value="<%= 
c.getRedirectUris() != null ? String.join(" ", c.getRedirectUris()) : "" %>" 
size="40" name="client_redirectURI"
+                               <input type="text" value="<%= 
c.getRedirectUris() != null ? StringEscapeUtils.escapeHtml4(String.join(" ", 
c.getRedirectUris())) : "" %>" size="40" name="client_redirectURI"
                                        placeholder="URL of the client to 
consume OIDC service response"
                                        id="input_6" data-type="input-textbox" 
/>
                        </div>
                        <div class="form-line">
                                <label for="client_audience" 
id="label_audience" class="form-label"> Audience URL </label>
-                               <input type="text" value="<%= 
c.getRegisteredAudiences() != null ? String.join(" ", 
c.getRegisteredAudiences()) : "" %>" size="40" name="client_audience"
+                               <input type="text" value="<%= 
c.getRegisteredAudiences() != null ? 
StringEscapeUtils.escapeHtml4(String.join(" ", c.getRegisteredAudiences())) : 
"" %>" size="40" name="client_audience"
                                        placeholder="URL of the server the 
tokens will be restricted to"
                                        id="input_7" data-type="input-textbox" 
/>
                        </div>
                        <div class="form-line">
                                <label for="client_logoutURI" id="label_logout" 
class="form-label"> Logout URL </label>
-                               <input type="text" value="<%= 
c.getProperties().get("post_logout_redirect_uris") != null ? 
c.getProperties().get("post_logout_redirect_uris") : "" %>" size="40" 
name="client_logoutURI"
+                               <input type="text" value="<%= 
c.getProperties().get("post_logout_redirect_uris") != null ? 
StringEscapeUtils.escapeHtml4(c.getProperties().get("post_logout_redirect_uris"))
 : "" %>" size="40" name="client_logoutURI"
                                        placeholder="URL of the client to 
finalize OIDC logout process"
                                        id="input_6" data-type="input-textbox" 
/>
                        </div>
diff --git a/services/oidc/src/main/webapp/WEB-INF/views/registeredClients.jsp 
b/services/oidc/src/main/webapp/WEB-INF/views/registeredClients.jsp
index cd4a2b13..ad99d205 100644
--- a/services/oidc/src/main/webapp/WEB-INF/views/registeredClients.jsp
+++ b/services/oidc/src/main/webapp/WEB-INF/views/registeredClients.jsp
@@ -49,7 +49,7 @@
            <% if(client.getRedirectUris() != null) {
                 for (String redirectURI : client.getRedirectUris()) {
                   %>
-           <%=    redirectURI %><br/>
+           <%= StringEscapeUtils.escapeHtml4(redirectURI) %><br/>
            <%   }
               } %>
            </td>

Reply via email to