@@ -0,0 +1,2290 @@
+package org.pdxfinder.web;%0A%0Aimport org.springframework.context.annotation.Configuration;%0Aimport org.springframework.security.config.annotation.web.builders.HttpSecurity;%0Aimport org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;%0Aimport org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;%0Aimport org.springframework.stereotype.Component;%0A%0Aimport javax.servlet.*;%0Aimport javax.servlet.http.HttpServletRequest;%0Aimport javax.servlet.http.HttpServletResponse;%0Aimport java.io.IOException;%0A%0A@EnableWebSecurity%0A@Configuration%0Apublic class SecurityConfig extends WebSecurityConfigurerAdapter %7B%0A%0A    @Override%0A    protected void configure(HttpSecurity http) throws Exception %7B%0A        http%0A                .headers()%0A                .xssProtection();%0A%0A    %7D%0A%0A%0A    @Component%0A    public class PdxFinderURLFilter implements Filter %7B%0A%0A        @Override%0A        public void destroy() %7B%7D%0A%0A%0A        @Override%0A        public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterchain)%0A                throws IOException, ServletException %7B%0A%0A            HttpServletRequest request = (HttpServletRequest) servletRequest;%0A            HttpServletResponse response = (HttpServletResponse) servletResponse;%0A%0A            System.out.println(%22Query String:%22+request.getQueryString());%0A            System.out.println(%22Remote Address:%22+request.getRequestURL().toString());%0A%0A%0A            System.out.println(%22Remote Address SANITIZED:%22+sanitize(request.getQueryString()));%0A%0A%0A            if (request.getRequestURI().contains(%22JAX%22))%7B%0A                response.sendRedirect(%22http://localhost:8080/data/search%22);%0A            %7Delse %7B%0A                filterchain.doFilter(servletRequest, servletResponse);%0A            %7D%0A%0A        %7D%0A%0A        @Override%0A        public void init(FilterConfig filterconfig) throws ServletException %7B%0A%0A        %7D%0A%0A        public String sanitize(String string) %7B%0A%0A            return string%0A                    .replaceAll(%22(?i)%3Cscript.*?%3E.*?%3C/script.*?%3E%22, %22%22)   // script tags%0A                    .replaceAll(%22(?i)%3C.*?.*?%3E.*?%3C/.*?%3E%22, %22%22) // js calls%0A                    .replaceAll(%22(?i)%3C.*?%5C%5Cs+on.*?%3E.*?%3C/.*?%3E%22, %22%22);     // remove %22font-size:11.0pt%22 lang=%22EN-U%0A%0A        %7D%0A    %7D%0A%0A%0A%7D%0A

Fix Potential XSS vulnerabilities : Added Spring Security Headers and Custom URL Filter Component