diff --git a/pom.xml b/pom.xml index d9052ee3..e8bf1638 100644 --- a/pom.xml +++ b/pom.xml @@ -16,6 +16,11 @@ + + org.apache.commons + commons-text + 1.12.0 + com.onelogin java-saml diff --git a/src/main/java/servlets/module/challenge/XssChallengeSix.java b/src/main/java/servlets/module/challenge/XssChallengeSix.java index 6aa964c7..01756818 100644 --- a/src/main/java/servlets/module/challenge/XssChallengeSix.java +++ b/src/main/java/servlets/module/challenge/XssChallengeSix.java @@ -1,6 +1,7 @@ package servlets.module.challenge; import dbProcs.Getter; +import org.apache.commons.text.StringEscapeUtils; import java.io.IOException; import java.io.PrintWriter; import java.util.Locale; @@ -80,7 +81,8 @@ public void doPost(HttpServletRequest request, HttpServletResponse response) String searchTerm = request.getParameter("searchTerm"); log.debug("User Submitted - " + searchTerm); searchTerm = XssFilter.anotherBadUrlValidate(searchTerm); - userPost = "Your HTTP Link!"; + String encodedSearchTerm = StringEscapeUtils.escapeHtml4(searchTerm); + userPost = "Your HTTP Link!"; log.debug("After Sanitising - " + searchTerm); boolean xssDetected = FindXSS.search(userPost);