Invalid location URI received from client -Exception

Hi,

I am getting below exception if i change any v-loc value from request due to this it is getting Stack Trace Disclosure
How to add custom error page this handle this.

Screenshot from 2024-10-18 11-33-08

java.lang.RuntimeException: Invalid location URI received from client
	at com.vaadin.server.Page.init(Page.java:775)
	at com.vaadin.ui.UI.doInit(UI.java:738)
	at com.vaadin.server.communication.UIInitHandler.getBrowserDetailsUI(UIInitHandler.java:209)
	at com.vaadin.server.communication.UIInitHandler.synchronizedHandleRequest(UIInitHandler.java:67)
	at com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:40)
	at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1636)
	at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:465)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:750)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:711)
	at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:459)
	at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:353)
	at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:313)
	at org.springframework.web.servlet.mvc.ServletForwardingController.handleRequestInternal(ServletForwardingController.java:141)
	at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:177)
	at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:51)
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1071)
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:964)
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
	at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:665)
	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:750)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
Caused by: java.net.URISyntaxException: Expected authority at index 8: https://
	at java.base/java.net.URI$Parser.fail(URI.java:2913)
	at java.base/java.net.URI$Parser.failExpecting(URI.java:2919)
	at java.base/java.net.URI$Parser.parseHierarchical(URI.java:3163)
	at java.base/java.net.URI$Parser.parse(URI.java:3114)
	at java.base/java.net.URI.<init>(URI.java:600)
	at com.vaadin.server.Page.init(Page.java:773)

Page class is it possible to override oninit method which throws runtime exception or any other way

 public void init(VaadinRequest request) {
        // NOTE: UI.refresh makes assumptions about the semantics of this
        // method.
        // It should be kept in sync if this method is changed.

        // Extract special parameter sent by vaadinBootstrap.js
        String location = request.getParameter("v-loc");
        String clientWidth = request.getParameter("v-cw");
        String clientHeight = request.getParameter("v-ch");
        windowName = request.getParameter("v-wn");

        if (location != null) {
            try {
                this.location = new URI(location);
            } catch (URISyntaxException e) {
                throw new RuntimeException(
                        "Invalid location URI received from client", e);
            }
        }
        if (clientWidth != null && clientHeight != null) {
            try {
                browserWindowWidth = Integer.parseInt(clientWidth);
                browserWindowHeight = Integer.parseInt(clientHeight);
            } catch (NumberFormatException e) {
                throw new RuntimeException(
                        "Invalid window size received from client", e);
            }
        }
    }

Below Response has errormessage which need to handled means it not print error in response


{"v-uiId":0,"uidl":"{\"Vaadin-Security-Key\":\"c1af4212-2a00-487a-8e3b-cfa8274e8c7e\",\"Vaadin-Push-ID\":\"11410c8c-3d23-4fb1-9aa7-1f3d28820066\",\"syncId\": 0, \"resynchronize\": true, \"clientId\": 0, \"changes\" : [[\"change\",{\"pid\":\"0\"},[\"0\",{\"id\":\"0\",\"lastHistoryOp\":\"push\"}]]], \"state\":{\"0\":{\"localeServiceState\":{\"localeData\":[{\"name\":\"en_GB\",\"monthNames\":[\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"],\"shortMonthNames\":[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"],\"shortDayNames\":[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],\"dayNames\":[\"Sunday\",\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\",\"Saturday\"],\"firstDayOfWeek\":1,\"dateFormat\":\"dd/MM/y\",\"twelveHourClock\":false,\"hourMinuteDelimiter\":\":\",\"am\":null,\"pm\":null}]},\"pushConfiguration\":{\"alwaysUseXhrForServerRequests\":true,\"mode\":\"AUTOMATIC\"},\"theme\":\"mcollectBase\",\"height\":\"100.0%\",\"width\":\"100.0%\",\"errorMessage\":\"<h2>java&#46;lang&#46;RuntimeException&#58;&#32;Invalid&#32;location&#32;URI&#32;received&#32;from&#32;client&#10;&#9;at&#32;com&#46;vaadin&#46;server&#46;Page&#46;init&#40;Page&#46;java&#58;775&#41;&#10;&#9;at&#32;com&#46;vaadin&#46;ui&#46;UI&#46;doInit&#40;UI&#46;java&#58;738&#41;&#10;&#9;at&#32;com&#46;vaadin&#46;server&#46;communication&#46;UIInitHandler&#46;getBrowserDetailsUI&#40;UIInitHandler&#46;java&#58;209&#41;&#10;&#9;at&#32;com&#46;vaadin&#46;server&#46;communication&#46;UIInitHandler&#46;synchronizedHandleRequest&#40;UIInitHandler&#46;java&#58;67&#41;&#10;&#9;at&#32;com&#46;vaadin&#46;server&#46;SynchronizedRequestHandler&#46;handleRequest&#40;SynchronizedRequestHandler&#46;java&#58;40&#41;&#10;&#9;at&#32;com&#46;vaadin&#46;server&#46;VaadinService&#46;handleRequest&#40;VaadinService&#46;java&#58;1636&#41;&#10;&#9;at&#32;com&#46;vaadin&#46;server&#46;VaadinServlet&#46;service&#40;VaadinServlet&#46;java&#58;465&#41;&#10;&#9;at&#32;javax&#46;servlet&#46;http&#46;HttpServlet&#46;service&#40;HttpServlet&#46;java&#58;750&#41;&#10;&#9;at&#32;org&#46;apache&#46;catalina&#46;core&#46;ApplicationFilterChain&#46;internalDoFilter&#40;ApplicationFilterChain&#46;java&#58;227&#41;&#10;&#9;at&#32;org&#46;apache&#46;catalina&#46;core&#46;ApplicationFilterChain&#46;doFilter&#40;ApplicationFilterChain&#46;java&#58;162&#41;&#10;&#9;at&#32;org&#46;apache&#46;catalina&#46;core&#46;ApplicationDispatcher&#46;invoke&#40;ApplicationDispatcher&#46;java&#58;711&#41;&#10;&#9;at&#32;org&#46;apache&#46;catalina&#46;core&#46;ApplicationDispatcher&#46;processRequest&#40;ApplicationDispatcher&#46;java&#58;459&#41;&#10;&#9;at&#32;org&#46;apache&#46;catalina&#46;core&#46;ApplicationDispatcher&#46;doForward&#40;ApplicationDispatcher&#46;java&#58;353&#41;&#10;&#9;at&#32;org&#46;apache&#46;catalina&#46;core&#46;ApplicationDispatcher&#46;forward&#40;ApplicationDispatcher&#46;java&#58;313&#41;&#10;&#9;at&#32;org&#46;springframework&#46;web&#46;servlet&#46;mvc&#46;ServletForwardingController&#46;handleRequestInternal&#40;ServletForwardingController&#46;java&#58;141&#41;&#10;&#9;at&#32;org&#46;springframework&#46;web&#46;servlet&#46;mvc&#46;AbstractController&#46;handleRequest&#40;AbstractController&#46;java&#58;177&#41;&#10;&#9;at&#32;org&#46;springframework&#46;web&#46;servlet&#46;mvc&#46;SimpleControllerHandlerAdapter&#46;handle&#40;SimpleControllerHandlerAdapter&#46;java&#58;51&#41;&#10;&#9;at&#32;org&#46;springframework&#46;web&#46;servlet&#46;DispatcherServlet&#46;doDispatch&#40;DispatcherServlet&#46;java&#58;1071&#41;&#10;&#9;at&#32;org&#46;springframework&#46;web&#46;servlet&#46;DispatcherServlet&#46;doService&#40;DispatcherServlet&#46;java&#58;964&#41;&#10;&#9;at&#32;org&#46;springframework&#46;web&#46;servlet&#46;FrameworkServlet&#46;processRequest&#40;FrameworkServlet&#46;java&#58;1006&#41;&#10;&#9;at&#32;org&#46;springframework&#46;web&#46;servlet&#46;FrameworkServlet&#46;doPost&#40;FrameworkServlet&#46;java&#58;909&#41;&#10;&#9;at&#32;javax&#46;servlet&#46;http&#46;HttpServlet&#46;service&#40;HttpServlet&#46;java&#58;665&#41;&#10;&#9;at&#32;org&#46;springframework&#46;web&#46;servlet&#46;FrameworkServlet&#46;service&#40;FrameworkServlet&#46;java&#58;883&#41;&#10;&#9;at&#32;javax&#46;servlet&#46;http&#46;HttpServlet&#46;service&#40;HttpServlet&#46;java&#58;750&#41;&#10;&#9;at&#32;org&#46;apache&#46;catalina&#46;core&#46;ApplicationFilterChain&#46;internalDoFilter&#40;ApplicationFilterChain&#46;java&#58;227&#41;&#10;&#9;at&#32;org&#46;apache&#46;catalina&#46;core&#46;ApplicationFilterChain&#46;doFilter&#40;ApplicationFilterChain&#46;java&#58;162&#41;&#10;&#9;at&#32;org&#46;apache&#46;tomcat&#46;websocket&#46;server&#46;WsFilter&#46;doFilter&#40;WsFilter&#46;java&#58;53&#41;&#10;&#9;at&#32;org&#46;apache&#46;catalina&#46;core&#46;ApplicationFilterChain&#46;internalDoFilter&#40;ApplicationFilterChain&#46;java&#58;189&#41;&#10;&#9;at&#32;org&#46;apache&#46;catalina&#46;core&#46;ApplicationFilterChain&#46;doFilter&#40;ApplicationFilterChain&#46;java&#58;162&#41;&#10;&#9;at&#32;com&#46;mobicule&#46;mcollectsettlementnew&#46;security&#46;MethodFilter&#46;doFilterInternal&#40;MethodFilter&#46;java&#58;23&#41;&#10;&#9;at&#32;org&#46;springframework&#46;web&#46;filter&#46;OncePerRequestFilter&#46;doFilter&#40;OncePerRequestFilter&#46;java&#58;117&#41;&#10;&#9;at&#32;org&#46;apache&#46;catalina&#46;core&#46;ApplicationFilterChain&#46;internalDoFilter&#40;ApplicationFilterChain&#46;java&#58;189&#41;&#10;&#9;at&#32;org&#46;apache&#46;catalina&#46;core&#46;ApplicationFilterChain&#46;doFilter&#40;ApplicationFilterChain&#46;java&#58;162&#41;&#10;&#9;at&#32;io&#46;jmix&#46;core&#46;impl&#46;logging&#46;LogMdcFilter&#46;doFilterInternal&#40;LogMdcFilter&#46;java&#58;28&#41;&#10;&#9;at&#32;org&#46;springframework&#46;web&#46;filter&#46;OncePerRequestFilter&#46;doFilter&#40;OncePerRequestFilter&#46;java&#58;117&#41;&#10;&#9;at&#32;org&#46;apache&#46;catalina&#46;core&#46;ApplicationFilterChain&#46;internalDoFilter&#40;ApplicationFilterChain&#46;java&#58;189&#41;&#10;&#9;at&#32;org&#46;apache&#46;catalina&#46;core&#46;ApplicationFilterChain&#46;doFilter&#40;ApplicationFilterChain&#46;java&#58;162&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;FilterChainProxy&#36;VirtualFilterChain&#46;doFilter&#40;FilterChainProxy&#46;java&#58;337&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;access&#46;intercept&#46;FilterSecurityInterceptor&#46;invoke&#40;FilterSecurityInterceptor&#46;java&#58;115&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;access&#46;intercept&#46;FilterSecurityInterceptor&#46;doFilter&#40;FilterSecurityInterceptor&#46;java&#58;81&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;FilterChainProxy&#36;VirtualFilterChain&#46;doFilter&#40;FilterChainProxy&#46;java&#58;346&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;access&#46;ExceptionTranslationFilter&#46;doFilter&#40;ExceptionTranslationFilter&#46;java&#58;122&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;access&#46;ExceptionTranslationFilter&#46;doFilter&#40;ExceptionTranslationFilter&#46;java&#58;116&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;FilterChainProxy&#36;VirtualFilterChain&#46;doFilter&#40;FilterChainProxy&#46;java&#58;346&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;session&#46;SessionManagementFilter&#46;doFilter&#40;SessionManagementFilter&#46;java&#58;126&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;session&#46;SessionManagementFilter&#46;doFilter&#40;SessionManagementFilter&#46;java&#58;81&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;FilterChainProxy&#36;VirtualFilterChain&#46;doFilter&#40;FilterChainProxy&#46;java&#58;346&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;authentication&#46;AnonymousAuthenticationFilter&#46;doFilter&#40;AnonymousAuthenticationFilter&#46;java&#58;109&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;FilterChainProxy&#36;VirtualFilterChain&#46;doFilter&#40;FilterChainProxy&#46;java&#58;346&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;authentication&#46;rememberme&#46;RememberMeAuthenticationFilter&#46;doFilter&#40;RememberMeAuthenticationFilter&#46;java&#58;141&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;authentication&#46;rememberme&#46;RememberMeAuthenticationFilter&#46;doFilter&#40;RememberMeAuthenticationFilter&#46;java&#58;97&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;FilterChainProxy&#36;VirtualFilterChain&#46;doFilter&#40;FilterChainProxy&#46;java&#58;346&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;servletapi&#46;SecurityContextHolderAwareRequestFilter&#46;doFilter&#40;SecurityContextHolderAwareRequestFilter&#46;java&#58;149&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;FilterChainProxy&#36;VirtualFilterChain&#46;doFilter&#40;FilterChainProxy&#46;java&#58;346&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;savedrequest&#46;RequestCacheAwareFilter&#46;doFilter&#40;RequestCacheAwareFilter&#46;java&#58;63&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;FilterChainProxy&#36;VirtualFilterChain&#46;doFilter&#40;FilterChainProxy&#46;java&#58;346&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;session&#46;ConcurrentSessionFilter&#46;doFilter&#40;ConcurrentSessionFilter&#46;java&#58;147&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;session&#46;ConcurrentSessionFilter&#46;doFilter&#40;ConcurrentSessionFilter&#46;java&#58;125&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;FilterChainProxy&#36;VirtualFilterChain&#46;doFilter&#40;FilterChainProxy&#46;java&#58;346&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;authentication&#46;logout&#46;LogoutFilter&#46;doFilter&#40;LogoutFilter&#46;java&#58;103&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;authentication&#46;logout&#46;LogoutFilter&#46;doFilter&#40;LogoutFilter&#46;java&#58;89&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;FilterChainProxy&#36;VirtualFilterChain&#46;doFilter&#40;FilterChainProxy&#46;java&#58;346&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;header&#46;HeaderWriterFilter&#46;doHeadersAfter&#40;HeaderWriterFilter&#46;java&#58;90&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;header&#46;HeaderWriterFilter&#46;doFilterInternal&#40;HeaderWriterFilter&#46;java&#58;75&#41;&#10;&#9;at&#32;org&#46;springframework&#46;web&#46;filter&#46;OncePerRequestFilter&#46;doFilter&#40;OncePerRequestFilter&#46;java&#58;117&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;FilterChainProxy&#36;VirtualFilterChain&#46;doFilter&#40;FilterChainProxy&#46;java&#58;346&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;context&#46;SecurityContextPersistenceFilter&#46;doFilter&#40;SecurityContextPersistenceFilter&#46;java&#58;112&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;context&#46;SecurityContextPersistenceFilter&#46;doFilter&#40;SecurityContextPersistenceFilter&#46;java&#58;82&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;FilterChainProxy&#36;VirtualFilterChain&#46;doFilter&#40;FilterChainProxy&#46;java&#58;346&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;context&#46;request&#46;async&#46;WebAsyncManagerIntegrationFilter&#46;doFilterInternal&#40;WebAsyncManagerIntegrationFilter&#46;java&#58;55&#41;&#10;&#9;at&#32;org&#46;springframework&#46;web&#46;filter&#46;OncePerRequestFilter&#46;doFilter&#40;OncePerRequestFilter&#46;java&#58;117&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;FilterChainProxy&#36;VirtualFilterChain&#46;doFilter&#40;FilterChainProxy&#46;java&#58;346&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;session&#46;DisableEncodeUrlFilter&#46;doFilterInternal&#40;DisableEncodeUrlFilter&#46;java&#58;42&#41;&#10;&#9;at&#32;org&#46;springframework&#46;web&#46;filter&#46;OncePerRequestFilter&#46;doFilter&#40;OncePerRequestFilter&#46;java&#58;117&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;FilterChainProxy&#36;VirtualFilterChain&#46;doFilter&#40;FilterChainProxy&#46;java&#58;346&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;FilterChainProxy&#46;doFilterInternal&#40;FilterChainProxy&#46;java&#58;221&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;FilterChainProxy&#46;doFilter&#40;FilterChainProxy&#46;java&#58;186&#41;&#10;&#9;at&#32;org&#46;springframework&#46;web&#46;filter&#46;DelegatingFilterProxy&#46;invokeDelegate&#40;DelegatingFilterProxy&#46;java&#58;354&#41;&#10;&#9;at&#32;org&#46;springframework&#46;web&#46;filter&#46;DelegatingFilterProxy&#46;doFilter&#40;DelegatingFilterProxy&#46;java&#58;267&#41;&#10;&#9;at&#32;org&#46;apache&#46;catalina&#46;core&#46;ApplicationFilterChain&#46;internalDoFilter&#40;ApplicationFilterChain&#46;java&#58;189&#41;&#10;&#9;at&#32;org&#46;apache&#46;catalina&#46;core&#46;ApplicationFilterChain&#46;doFilter&#40;ApplicationFilterChain&#46;java&#58;162&#41;&#10;&#9;at&#32;org&#46;springframework&#46;web&#46;filter&#46;CharacterEncodingFilter&#46;doFilterInternal&#40;CharacterEncodingFilter&#46;java&#58;201&#41;&#10;&#9;at&#32;org&#46;springframework&#46;web&#46;filter&#46;OncePerRequestFilter&#46;doFilter&#40;OncePerRequestFilter&#46;java&#58;117&#41;&#10;&#9;at&#32;org&#46;apache&#46;catalina&#46;core&#46;ApplicationFilterChain&#46;internalDoFilter&#40;ApplicationFilterChain&#46;java&#58;189&#41;&#10;&#9;at&#32;org&#46;apache&#46;catalina&#46;core&#46;ApplicationFilterChain&#46;doFilter&#40;ApplicationFilterChain&#46;java&#58;162&#41;&#10;&#9;at&#32;org&#46;apache&#46;catalina&#46;core&#46;StandardWrapperValve&#46;invoke&#40;StandardWrapperValve&#46;java&#58;177&#41;&#10;&#9;at&#32;org&#46;apache&#46;catalina&#46;core&#46;StandardContextValve&#46;invoke&#40;StandardContextValve&#46;java&#58;97&#41;&#10;&#9;at&#32;org&#46;apache&#46;catalina&#46;authenticator&#46;AuthenticatorBase&#46;invoke&#40;AuthenticatorBase&#46;java&#58;541&#41;&#10;&#9;at&#32;org&#46;apache&#46;catalina&#46;core&#46;StandardHostValve&#46;invoke&#40;StandardHostValve&#46;java&#58;135&#41;&#10;&#9;at&#32;org&#46;apache&#46;catalina&#46;valves&#46;ErrorReportValve&#46;invoke&#40;ErrorReportValve&#46;java&#58;92&#41;&#10;&#9;at&#32;org&#46;apache&#46;catalina&#46;core&#46;StandardEngineValve&#46;invoke&#40;StandardEngineValve&#46;java&#58;78&#41;&#10;&#9;at&#32;org&#46;apache&#46;catalina&#46;connector&#46;CoyoteAdapter&#46;service&#40;CoyoteAdapter&#46;java&#58;360&#41;&#10;&#9;at&#32;org&#46;apache&#46;coyote&#46;http11&#46;Http11Processor&#46;service&#40;Http11Processor&#46;java&#58;399&#41;&#10;&#9;at&#32;org&#46;apache&#46;coyote&#46;AbstractProcessorLight&#46;process&#40;AbstractProcessorLight&#46;java&#58;65&#41;&#10;&#9;at&#32;org&#46;apache&#46;coyote&#46;AbstractProtocol&#36;ConnectionHandler&#46;process&#40;AbstractProtocol&#46;java&#58;891&#41;&#10;&#9;at&#32;org&#46;apache&#46;tomcat&#46;util&#46;net&#46;NioEndpoint&#36;SocketProcessor&#46;doRun&#40;NioEndpoint&#46;java&#58;1784&#41;&#10;&#9;at&#32;org&#46;apache&#46;tomcat&#46;util&#46;net&#46;SocketProcessorBase&#46;run&#40;SocketProcessorBase&#46;java&#58;49&#41;&#10;&#9;at&#32;org&#46;apache&#46;tomcat&#46;util&#46;threads&#46;ThreadPoolExecutor&#46;runWorker&#40;ThreadPoolExecutor&#46;java&#58;1191&#41;&#10;&#9;at&#32;org&#46;apache&#46;tomcat&#46;util&#46;threads&#46;ThreadPoolExecutor&#36;Worker&#46;run&#40;ThreadPoolExecutor&#46;java&#58;659&#41;&#10;&#9;at&#32;org&#46;apache&#46;tomcat&#46;util&#46;threads&#46;TaskThread&#36;WrappingRunnable&#46;run&#40;TaskThread&#46;java&#58;61&#41;&#10;&#9;at&#32;java&#46;base&#47;java&#46;lang&#46;Thread&#46;run&#40;Thread&#46;java&#58;829&#41;&#10;Caused&#32;by&#58;&#32;java&#46;net&#46;URISyntaxException&#58;&#32;Expected&#32;authority&#32;at&#32;index&#32;7&#58;&#32;http&#58;&#47;&#47;&#10;&#9;at&#32;java&#46;base&#47;java&#46;net&#46;URI&#36;Parser&#46;fail&#40;URI&#46;java&#58;2913&#41;&#10;&#9;at&#32;java&#46;base&#47;java&#46;net&#46;URI&#36;Parser&#46;failExpecting&#40;URI&#46;java&#58;2919&#41;&#10;&#9;at&#32;java&#46;base&#47;java&#46;net&#46;URI&#36;Parser&#46;parseHierarchical&#40;URI&#46;java&#58;3163&#41;&#10;&#9;at&#32;java&#46;base&#47;java&#46;net&#46;URI&#36;Parser&#46;parse&#40;URI&#46;java&#58;3114&#41;&#10;&#9;at&#32;java&#46;base&#47;java&#46;net&#46;URI&#46;&#60;init&#62;&#40;URI&#46;java&#58;600&#41;&#10;&#9;at&#32;com&#46;vaadin&#46;server&#46;Page&#46;init&#40;Page&#46;java&#58;773&#41;&#10;&#9;&#46;&#46;&#46;&#32;100&#32;more&#10;</h2>\",\"errorLevel\":\"SYSTEM\",\"registeredEventListeners\":[\"clientConnectorDetach\"]}}, \"types\":{\"0\":\"0\"}, \"hierarchy\":{}, \"rpc\" : [], \"meta\" : {\"repaintAll\":true}, \"resources\" : {}, \"typeMappings\" : { \"com.vaadin.ui.AbstractComponent\" : 1 , \"com.vaadin.ui.AbstractSingleComponentContainer\" : 2 , \"com.vaadin.ui.UI\" : 3 , \"io.jmix.ui.AppUI\" : 0 , \"com.vaadin.server.AbstractClientConnector\" : 4 }, \"typeInheritanceMap\" : { \"1\" : 4 , \"2\" : 1 , \"3\" : 2 , \"0\" : 3 }, \"timings\":[0, -1]}"}

Screenshot from 2024-10-18 11-33-08

Hi,

Could you please describe in more detail how to reproduce the issue and why you need to change the v-loc values that are used by Vaadin’s internal logic?

Regards,
Gleb

in bursuite i had modified the v-browserDetails parameter by using burp suite application.

Step 1: search for v- Post Request http://localhost:8083/?v-1729233344879
step1

Step 2 : change the v-loc parameter values to https://
step2

Output:
image

You can implement custim Exception Handler for URISyntaxException, e.g.:

@Component("demo_URISyntaxExceptionHandler")
public class URISyntaxExceptionHandler extends AbstractUiExceptionHandler {

    public URISyntaxExceptionHandler() {
        super(URISyntaxException.class.getName());
    }

    @Override
    protected void doHandle(String className, String message,
                            @Nullable Throwable throwable, UiContext context) {
        // do handle
    }
}

Also, pay attention that v-loc value contains a full URL for the request, e.g.

Screenshot 2024-10-18 at 19.19.56
Screenshot 2024-10-18 at 19.20.02

Probably, instead of changing it to an unparsable value that produces exception, it’d be better to set https://localhost:8080.

Regards,
Gleb

HI,

Jmix 1.5 version
I had added below code but still 1. Stack Trace Disclosure are getting in response.

Probably, instead of changing it to an unparsable value that produces exception, it’d be better to set https://localhost:8080 . - this changes are being done by application security and they are getting this stacktrace which help in identitying detail - Stack Trace Disclosure

@Component("uiex1_URISyntaxExceptionHandler")
public class URISyntaxExceptionHandler extends AbstractUiExceptionHandler {

    public URISyntaxExceptionHandler() {
        super(URISyntaxException.class.getName());
    }

    @Override
    protected boolean canHandle(String className, String message,
                                @Nullable Throwable throwable) {
        return StringUtils.containsIgnoreCase(message,
                "Internal Server Error");
    }

    @Override
    protected void doHandle(String className, String message, @org.jetbrains.annotations.Nullable Throwable throwable, UiContext context) {
        try {
            context.getNotifications().create(Notifications.NotificationType.ERROR)
                    .withCaption("Error")
                    .withDescription("Internal Server Error")
                    .show();


        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

this will handle the stacktrace getting print on UI dialog box but still this error is getting print in jmix response

HTTP/1.1 200 
Set-Cookie: JSESSIONID=0F42748150ED3793F68439DD705DAB28; Path=/; Secure; HttpOnly; SameSite=Strict
Cache-Control: no-cache, no-store, must-revalidate
Pragma: no-cache
Expires: 0
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
Content-Type: application/json;charset=UTF-8
Content-Length: 17564
Date: Fri, 18 Oct 2024 16:18:30 GMT
Keep-Alive: timeout=60
Connection: keep-alive

{"v-uiId":0,"uidl":"{\"Vaadin-Security-Key\":\"499193cc-e122-43b5-8401-c20a1809b255\",\"Vaadin-Push-ID\":\"67c67409-24a0-4704-905c-5157fae8763a\",\"syncId\": 0, \"resynchronize\": true, \"clientId\": 0, \"changes\" : [[\"change\",{\"pid\":\"0\"},[\"0\",{\"id\":\"0\",\"lastHistoryOp\":\"push\"}]]], \"state\":{\"0\":{\"localeServiceState\":{\"localeData\":[{\"name\":\"en_GB\",\"monthNames\":[\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"],\"shortMonthNames\":[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"],\"shortDayNames\":[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],\"dayNames\":[\"Sunday\",\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\",\"Saturday\"],\"firstDayOfWeek\":1,\"dateFormat\":\"dd/MM/y\",\"twelveHourClock\":false,\"hourMinuteDelimiter\":\":\",\"am\":null,\"pm\":null}]},\"pushConfiguration\":{\"alwaysUseXhrForServerRequests\":true,\"mode\":\"AUTOMATIC\"},\"theme\":\"mcollectBase\",\"height\":\"100.0%\",\"width\":\"100.0%\",\"errorMessage\":\"<h2>java&#46;lang&#46;RuntimeException&#58;&#32;Invalid&#32;location&#32;URI&#32;received&#32;from&#32;client&#10;&#9;at&#32;com&#46;vaadin&#46;server&#46;Page&#46;init&#40;Page&#46;java&#58;775&#41;&#10;&#9;at&#32;com&#46;vaadin&#46;ui&#46;UI&#46;doInit&#40;UI&#46;java&#58;738&#41;&#10;&#9;at&#32;com&#46;vaadin&#46;server&#46;communication&#46;UIInitHandler&#46;getBrowserDetailsUI&#40;UIInitHandler&#46;java&#58;209&#41;&#10;&#9;at&#32;com&#46;vaadin&#46;server&#46;communication&#46;UIInitHandler&#46;synchronizedHandleRequest&#40;UIInitHandler&#46;java&#58;67&#41;&#10;&#9;at&#32;com&#46;vaadin&#46;server&#46;SynchronizedRequestHandler&#46;handleRequest&#40;SynchronizedRequestHandler&#46;java&#58;40&#41;&#10;&#9;at&#32;com&#46;vaadin&#46;server&#46;VaadinService&#46;handleRequest&#40;VaadinService&#46;java&#58;1636&#41;&#10;&#9;at&#32;com&#46;vaadin&#46;server&#46;VaadinServlet&#46;service&#40;VaadinServlet&#46;java&#58;465&#41;&#10;&#9;at&#32;javax&#46;servlet&#46;http&#46;HttpServlet&#46;service&#40;HttpServlet&#46;java&#58;750&#41;&#10;&#9;at&#32;org&#46;apache&#46;catalina&#46;core&#46;ApplicationFilterChain&#46;internalDoFilter&#40;ApplicationFilterChain&#46;java&#58;227&#41;&#10;&#9;at&#32;org&#46;apache&#46;catalina&#46;core&#46;ApplicationFilterChain&#46;doFilter&#40;ApplicationFilterChain&#46;java&#58;162&#41;&#10;&#9;at&#32;org&#46;apache&#46;catalina&#46;core&#46;ApplicationDispatcher&#46;invoke&#40;ApplicationDispatcher&#46;java&#58;711&#41;&#10;&#9;at&#32;org&#46;apache&#46;catalina&#46;core&#46;ApplicationDispatcher&#46;processRequest&#40;ApplicationDispatcher&#46;java&#58;459&#41;&#10;&#9;at&#32;org&#46;apache&#46;catalina&#46;core&#46;ApplicationDispatcher&#46;doForward&#40;ApplicationDispatcher&#46;java&#58;353&#41;&#10;&#9;at&#32;org&#46;apache&#46;catalina&#46;core&#46;ApplicationDispatcher&#46;forward&#40;ApplicationDispatcher&#46;java&#58;313&#41;&#10;&#9;at&#32;org&#46;springframework&#46;web&#46;servlet&#46;mvc&#46;ServletForwardingController&#46;handleRequestInternal&#40;ServletForwardingController&#46;java&#58;141&#41;&#10;&#9;at&#32;org&#46;springframework&#46;web&#46;servlet&#46;mvc&#46;AbstractController&#46;handleRequest&#40;AbstractController&#46;java&#58;177&#41;&#10;&#9;at&#32;org&#46;springframework&#46;web&#46;servlet&#46;mvc&#46;SimpleControllerHandlerAdapter&#46;handle&#40;SimpleControllerHandlerAdapter&#46;java&#58;51&#41;&#10;&#9;at&#32;org&#46;springframework&#46;web&#46;servlet&#46;DispatcherServlet&#46;doDispatch&#40;DispatcherServlet&#46;java&#58;1071&#41;&#10;&#9;at&#32;org&#46;springframework&#46;web&#46;servlet&#46;DispatcherServlet&#46;doService&#40;DispatcherServlet&#46;java&#58;964&#41;&#10;&#9;at&#32;org&#46;springframework&#46;web&#46;servlet&#46;FrameworkServlet&#46;processRequest&#40;FrameworkServlet&#46;java&#58;1006&#41;&#10;&#9;at&#32;org&#46;springframework&#46;web&#46;servlet&#46;FrameworkServlet&#46;doPost&#40;FrameworkServlet&#46;java&#58;909&#41;&#10;&#9;at&#32;javax&#46;servlet&#46;http&#46;HttpServlet&#46;service&#40;HttpServlet&#46;java&#58;665&#41;&#10;&#9;at&#32;org&#46;springframework&#46;web&#46;servlet&#46;FrameworkServlet&#46;service&#40;FrameworkServlet&#46;java&#58;883&#41;&#10;&#9;at&#32;javax&#46;servlet&#46;http&#46;HttpServlet&#46;service&#40;HttpServlet&#46;java&#58;750&#41;&#10;&#9;at&#32;org&#46;apache&#46;catalina&#46;core&#46;ApplicationFilterChain&#46;internalDoFilter&#40;ApplicationFilterChain&#46;java&#58;227&#41;&#10;&#9;at&#32;org&#46;apache&#46;catalina&#46;core&#46;ApplicationFilterChain&#46;doFilter&#40;ApplicationFilterChain&#46;java&#58;162&#41;&#10;&#9;at&#32;org&#46;apache&#46;tomcat&#46;websocket&#46;server&#46;WsFilter&#46;doFilter&#40;WsFilter&#46;java&#58;53&#41;&#10;&#9;at&#32;org&#46;apache&#46;catalina&#46;core&#46;ApplicationFilterChain&#46;internalDoFilter&#40;ApplicationFilterChain&#46;java&#58;189&#41;&#10;&#9;at&#32;org&#46;apache&#46;catalina&#46;core&#46;ApplicationFilterChain&#46;doFilter&#40;ApplicationFilterChain&#46;java&#58;162&#41;&#10;&#9;at&#32;com&#46;mobicule&#46;mcollectsettlementnew&#46;security&#46;MethodFilter&#46;doFilterInternal&#40;MethodFilter&#46;java&#58;23&#41;&#10;&#9;at&#32;org&#46;springframework&#46;web&#46;filter&#46;OncePerRequestFilter&#46;doFilter&#40;OncePerRequestFilter&#46;java&#58;117&#41;&#10;&#9;at&#32;org&#46;apache&#46;catalina&#46;core&#46;ApplicationFilterChain&#46;internalDoFilter&#40;ApplicationFilterChain&#46;java&#58;189&#41;&#10;&#9;at&#32;org&#46;apache&#46;catalina&#46;core&#46;ApplicationFilterChain&#46;doFilter&#40;ApplicationFilterChain&#46;java&#58;162&#41;&#10;&#9;at&#32;io&#46;jmix&#46;core&#46;impl&#46;logging&#46;LogMdcFilter&#46;doFilterInternal&#40;LogMdcFilter&#46;java&#58;28&#41;&#10;&#9;at&#32;org&#46;springframework&#46;web&#46;filter&#46;OncePerRequestFilter&#46;doFilter&#40;OncePerRequestFilter&#46;java&#58;117&#41;&#10;&#9;at&#32;org&#46;apache&#46;catalina&#46;core&#46;ApplicationFilterChain&#46;internalDoFilter&#40;ApplicationFilterChain&#46;java&#58;189&#41;&#10;&#9;at&#32;org&#46;apache&#46;catalina&#46;core&#46;ApplicationFilterChain&#46;doFilter&#40;ApplicationFilterChain&#46;java&#58;162&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;FilterChainProxy&#36;VirtualFilterChain&#46;doFilter&#40;FilterChainProxy&#46;java&#58;337&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;access&#46;intercept&#46;FilterSecurityInterceptor&#46;invoke&#40;FilterSecurityInterceptor&#46;java&#58;115&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;access&#46;intercept&#46;FilterSecurityInterceptor&#46;doFilter&#40;FilterSecurityInterceptor&#46;java&#58;81&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;FilterChainProxy&#36;VirtualFilterChain&#46;doFilter&#40;FilterChainProxy&#46;java&#58;346&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;access&#46;ExceptionTranslationFilter&#46;doFilter&#40;ExceptionTranslationFilter&#46;java&#58;122&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;access&#46;ExceptionTranslationFilter&#46;doFilter&#40;ExceptionTranslationFilter&#46;java&#58;116&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;FilterChainProxy&#36;VirtualFilterChain&#46;doFilter&#40;FilterChainProxy&#46;java&#58;346&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;session&#46;SessionManagementFilter&#46;doFilter&#40;SessionManagementFilter&#46;java&#58;126&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;session&#46;SessionManagementFilter&#46;doFilter&#40;SessionManagementFilter&#46;java&#58;81&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;FilterChainProxy&#36;VirtualFilterChain&#46;doFilter&#40;FilterChainProxy&#46;java&#58;346&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;authentication&#46;AnonymousAuthenticationFilter&#46;doFilter&#40;AnonymousAuthenticationFilter&#46;java&#58;109&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;FilterChainProxy&#36;VirtualFilterChain&#46;doFilter&#40;FilterChainProxy&#46;java&#58;346&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;authentication&#46;rememberme&#46;RememberMeAuthenticationFilter&#46;doFilter&#40;RememberMeAuthenticationFilter&#46;java&#58;141&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;authentication&#46;rememberme&#46;RememberMeAuthenticationFilter&#46;doFilter&#40;RememberMeAuthenticationFilter&#46;java&#58;97&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;FilterChainProxy&#36;VirtualFilterChain&#46;doFilter&#40;FilterChainProxy&#46;java&#58;346&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;servletapi&#46;SecurityContextHolderAwareRequestFilter&#46;doFilter&#40;SecurityContextHolderAwareRequestFilter&#46;java&#58;149&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;FilterChainProxy&#36;VirtualFilterChain&#46;doFilter&#40;FilterChainProxy&#46;java&#58;346&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;savedrequest&#46;RequestCacheAwareFilter&#46;doFilter&#40;RequestCacheAwareFilter&#46;java&#58;63&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;FilterChainProxy&#36;VirtualFilterChain&#46;doFilter&#40;FilterChainProxy&#46;java&#58;346&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;session&#46;ConcurrentSessionFilter&#46;doFilter&#40;ConcurrentSessionFilter&#46;java&#58;147&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;session&#46;ConcurrentSessionFilter&#46;doFilter&#40;ConcurrentSessionFilter&#46;java&#58;125&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;FilterChainProxy&#36;VirtualFilterChain&#46;doFilter&#40;FilterChainProxy&#46;java&#58;346&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;authentication&#46;logout&#46;LogoutFilter&#46;doFilter&#40;LogoutFilter&#46;java&#58;103&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;authentication&#46;logout&#46;LogoutFilter&#46;doFilter&#40;LogoutFilter&#46;java&#58;89&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;FilterChainProxy&#36;VirtualFilterChain&#46;doFilter&#40;FilterChainProxy&#46;java&#58;346&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;header&#46;HeaderWriterFilter&#46;doHeadersAfter&#40;HeaderWriterFilter&#46;java&#58;90&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;header&#46;HeaderWriterFilter&#46;doFilterInternal&#40;HeaderWriterFilter&#46;java&#58;75&#41;&#10;&#9;at&#32;org&#46;springframework&#46;web&#46;filter&#46;OncePerRequestFilter&#46;doFilter&#40;OncePerRequestFilter&#46;java&#58;117&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;FilterChainProxy&#36;VirtualFilterChain&#46;doFilter&#40;FilterChainProxy&#46;java&#58;346&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;context&#46;SecurityContextPersistenceFilter&#46;doFilter&#40;SecurityContextPersistenceFilter&#46;java&#58;112&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;context&#46;SecurityContextPersistenceFilter&#46;doFilter&#40;SecurityContextPersistenceFilter&#46;java&#58;82&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;FilterChainProxy&#36;VirtualFilterChain&#46;doFilter&#40;FilterChainProxy&#46;java&#58;346&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;context&#46;request&#46;async&#46;WebAsyncManagerIntegrationFilter&#46;doFilterInternal&#40;WebAsyncManagerIntegrationFilter&#46;java&#58;55&#41;&#10;&#9;at&#32;org&#46;springframework&#46;web&#46;filter&#46;OncePerRequestFilter&#46;doFilter&#40;OncePerRequestFilter&#46;java&#58;117&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;FilterChainProxy&#36;VirtualFilterChain&#46;doFilter&#40;FilterChainProxy&#46;java&#58;346&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;session&#46;DisableEncodeUrlFilter&#46;doFilterInternal&#40;DisableEncodeUrlFilter&#46;java&#58;42&#41;&#10;&#9;at&#32;org&#46;springframework&#46;web&#46;filter&#46;OncePerRequestFilter&#46;doFilter&#40;OncePerRequestFilter&#46;java&#58;117&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;FilterChainProxy&#36;VirtualFilterChain&#46;doFilter&#40;FilterChainProxy&#46;java&#58;346&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;FilterChainProxy&#46;doFilterInternal&#40;FilterChainProxy&#46;java&#58;221&#41;&#10;&#9;at&#32;org&#46;springframework&#46;security&#46;web&#46;FilterChainProxy&#46;doFilter&#40;FilterChainProxy&#46;java&#58;186&#41;&#10;&#9;at&#32;org&#46;springframework&#46;web&#46;filter&#46;DelegatingFilterProxy&#46;invokeDelegate&#40;DelegatingFilterProxy&#46;java&#58;354&#41;&#10;&#9;at&#32;org&#46;springframework&#46;web&#46;filter&#46;DelegatingFilterProxy&#46;doFilter&#40;DelegatingFilterProxy&#46;java&#58;267&#41;&#10;&#9;at&#32;org&#46;apache&#46;catalina&#46;core&#46;ApplicationFilterChain&#46;internalDoFilter&#40;ApplicationFilterChain&#46;java&#58;189&#41;&#10;&#9;at&#32;org&#46;apache&#46;catalina&#46;core&#46;ApplicationFilterChain&#46;doFilter&#40;ApplicationFilterChain&#46;java&#58;162&#41;&#10;&#9;at&#32;org&#46;springframework&#46;web&#46;filter&#46;CharacterEncodingFilter&#46;doFilterInternal&#40;CharacterEncodingFilter&#46;java&#58;201&#41;&#10;&#9;at&#32;org&#46;springframework&#46;web&#46;filter&#46;OncePerRequestFilter&#46;doFilter&#40;OncePerRequestFilter&#46;java&#58;117&#41;&#10;&#9;at&#32;org&#46;apache&#46;catalina&#46;core&#46;ApplicationFilterChain&#46;internalDoFilter&#40;ApplicationFilterChain&#46;java&#58;189&#41;&#10;&#9;at&#32;org&#46;apache&#46;catalina&#46;core&#46;ApplicationFilterChain&#46;doFilter&#40;ApplicationFilterChain&#46;java&#58;162&#41;&#10;&#9;at&#32;org&#46;apache&#46;catalina&#46;core&#46;StandardWrapperValve&#46;invoke&#40;StandardWrapperValve&#46;java&#58;177&#41;&#10;&#9;at&#32;org&#46;apache&#46;catalina&#46;core&#46;StandardContextValve&#46;invoke&#40;StandardContextValve&#46;java&#58;97&#41;&#10;&#9;at&#32;org&#46;apache&#46;catalina&#46;authenticator&#46;AuthenticatorBase&#46;invoke&#40;AuthenticatorBase&#46;java&#58;541&#41;&#10;&#9;at&#32;org&#46;apache&#46;catalina&#46;core&#46;StandardHostValve&#46;invoke&#40;StandardHostValve&#46;java&#58;135&#41;&#10;&#9;at&#32;org&#46;apache&#46;catalina&#46;valves&#46;ErrorReportValve&#46;invoke&#40;ErrorReportValve&#46;java&#58;92&#41;&#10;&#9;at&#32;org&#46;apache&#46;catalina&#46;core&#46;StandardEngineValve&#46;invoke&#40;StandardEngineValve&#46;java&#58;78&#41;&#10;&#9;at&#32;org&#46;apache&#46;catalina&#46;connector&#46;CoyoteAdapter&#46;service&#40;CoyoteAdapter&#46;java&#58;360&#41;&#10;&#9;at&#32;org&#46;apache&#46;coyote&#46;http11&#46;Http11Processor&#46;service&#40;Http11Processor&#46;java&#58;399&#41;&#10;&#9;at&#32;org&#46;apache&#46;coyote&#46;AbstractProcessorLight&#46;process&#40;AbstractProcessorLight&#46;java&#58;65&#41;&#10;&#9;at&#32;org&#46;apache&#46;coyote&#46;AbstractProtocol&#36;ConnectionHandler&#46;process&#40;AbstractProtocol&#46;java&#58;891&#41;&#10;&#9;at&#32;org&#46;apache&#46;tomcat&#46;util&#46;net&#46;NioEndpoint&#36;SocketProcessor&#46;doRun&#40;NioEndpoint&#46;java&#58;1784&#41;&#10;&#9;at&#32;org&#46;apache&#46;tomcat&#46;util&#46;net&#46;SocketProcessorBase&#46;run&#40;SocketProcessorBase&#46;java&#58;49&#41;&#10;&#9;at&#32;org&#46;apache&#46;tomcat&#46;util&#46;threads&#46;ThreadPoolExecutor&#46;runWorker&#40;ThreadPoolExecutor&#46;java&#58;1191&#41;&#10;&#9;at&#32;org&#46;apache&#46;tomcat&#46;util&#46;threads&#46;ThreadPoolExecutor&#36;Worker&#46;run&#40;ThreadPoolExecutor&#46;java&#58;659&#41;&#10;&#9;at&#32;org&#46;apache&#46;tomcat&#46;util&#46;threads&#46;TaskThread&#36;WrappingRunnable&#46;run&#40;TaskThread&#46;java&#58;61&#41;&#10;&#9;at&#32;java&#46;base&#47;java&#46;lang&#46;Thread&#46;run&#40;Thread&#46;java&#58;829&#41;&#10;Caused&#32;by&#58;&#32;java&#46;net&#46;URISyntaxException&#58;&#32;Expected&#32;authority&#32;at&#32;index&#32;8&#58;&#32;https&#58;&#47;&#47;&#10;&#9;at&#32;java&#46;base&#47;java&#46;net&#46;URI&#36;Parser&#46;fail&#40;URI&#46;java&#58;2913&#41;&#10;&#9;at&#32;java&#46;base&#47;java&#46;net&#46;URI&#36;Parser&#46;failExpecting&#40;URI&#46;java&#58;2919&#41;&#10;&#9;at&#32;java&#46;base&#47;java&#46;net&#46;URI&#36;Parser&#46;parseHierarchical&#40;URI&#46;java&#58;3163&#41;&#10;&#9;at&#32;java&#46;base&#47;java&#46;net&#46;URI&#36;Parser&#46;parse&#40;URI&#46;java&#58;3114&#41;&#10;&#9;at&#32;java&#46;base&#47;java&#46;net&#46;URI&#46;&#60;init&#62;&#40;URI&#46;java&#58;600&#41;&#10;&#9;at&#32;com&#46;vaadin&#46;server&#46;Page&#46;init&#40;Page&#46;java&#58;773&#41;&#10;&#9;&#46;&#46;&#46;&#32;100&#32;more&#10;</h2>\",\"errorLevel\":\"SYSTEM\",\"registeredEventListeners\":[\"clientConnectorDetach\"]}}, \"types\":{\"0\":\"0\"}, \"hierarchy\":{}, \"rpc\" : [], \"meta\" : {\"repaintAll\":true}, \"resources\" : {}, \"typeMappings\" : { \"io.jmix.ui.AppUI\" : 0 , \"com.vaadin.ui.AbstractComponent\" : 1 , \"com.vaadin.server.AbstractClientConnector\" : 2 , \"com.vaadin.ui.AbstractSingleComponentContainer\" : 3 , \"com.vaadin.ui.UI\" : 4 }, \"typeInheritanceMap\" : { \"0\" : 4 , \"1\" : 2 , \"3\" : 1 , \"4\" : 3 }, \"timings\":[0, -1]}"}```

Hi Glen,

Any solution for this ?

If we add custom message instead of stack trace in below code to fix, for v-cw scenario exception may also be printed.

Class Name - > Page

public void init(VaadinRequest request) {
        // NOTE: UI.refresh makes assumptions about the semantics of this
        // method.
        // It should be kept in sync if this method is changed.

        // Extract special parameter sent by vaadinBootstrap.js
        String location = request.getParameter("v-loc");
        String clientWidth = request.getParameter("v-cw");
        String clientHeight = request.getParameter("v-ch");
        windowName = request.getParameter("v-wn");

        if (location != null) {
            try {
                this.location = new URI(location);
            } catch (URISyntaxException e) {
                throw new RuntimeException(
                        "Invalid location URI received from client", e);
            }
        }
        if (clientWidth != null && clientHeight != null) {
            try {
                browserWindowWidth = Integer.parseInt(clientWidth);
                browserWindowHeight = Integer.parseInt(clientHeight);
            } catch (NumberFormatException e) {
                throw new RuntimeException(
                        "Invalid window size received from client", e);
            }
        }
    }

That is right, AbstractUiExceptionHandler inheritors handle exceptions, so that instead of the Unexpected error dialog you can display something more user friendly.

The Page class cannot be overridden because it’s a private field of the UI class with inline initialization:

private Page page = new Page(this, getState(false).pageState);

So the only option to fix the exception is to set the v-loc value to something parseable.

Regards,
Gleb

@krivopustov whats your opinion on this?

This issue has come as critical one from the application security team which need to be tackled on priority. Please help us in closing the same.

To prevent exception stacktrace to be printed in response, instead of overriding Page, I’d recommendto replace DefaultErrorHandler which is set before UI is initialized.

To do so:

  1. Create custom VaadinServlet that extends JmixVaadinServlet
public class CustomVaadinServlet extends JmixVaadinServlet {

    public CustomVaadinServlet(ApplicationContext applicationContext) {
        super(applicationContext);
    }

    @Override
    protected VaadinServletService createServletService(DeploymentConfiguration deploymentConfiguration) throws ServiceException {
        JmixVaadinServletService service =
                new CustomVaadinServletService(this, deploymentConfiguration, getServiceUrlPath(), applicationContext);
        service.init();
        return service;
    }
}

And register it in the main applications class (or any other configuration class):

@Bean
public VaadinServlet vaadinServlet(ApplicationContext applicationContext) {
    return new CustomVaadinServlet(applicationContext);
}
  1. Implement custom VaadinServletService that extends JmixVaadinServletService
public class CustomVaadinServletService extends JmixVaadinServletService {

    public CustomVaadinServletService(VaadinServlet servlet,
                                      DeploymentConfiguration deploymentConfiguration,
                                      String serviceUrl,
                                      ApplicationContext applicationContext) throws ServiceException {
        super(servlet, deploymentConfiguration, serviceUrl, applicationContext);
    }

    @Override
    protected VaadinSession createVaadinSession(VaadinRequest request) throws ServiceException {
        VaadinSession vaadinSession = super.createVaadinSession(request);
        vaadinSession.setErrorHandler(new CustomErrorHandler());
        return vaadinSession;
    }
}

it’s needed to initialize VaadinSession right after it’s created and set custom ErrorHandler that extends DefaultErrorHandler.

  1. In CustomErrorHandler do not set error message to the component if it’s AppUI, so no error message is seriallized is sent as response:
public class CustomErrorHandler extends DefaultErrorHandler {

    @Override
    public void error(ErrorEvent event) {
        AbstractComponent component = findAbstractComponent(event);
        if (component instanceof AppUI
                && !(event.getThrowable() instanceof SocketException)) {
            doHandle(event);
        } else {
            super.error(event);
        }
    }

    private void doHandle(ErrorEvent event) {
        Throwable t = findRelevantThrowable(event.getThrowable());
        getLogger().error("", t);
    }

    private static Logger getLogger() {
        return LoggerFactory.getLogger(CustomErrorHandler.class);
    }
}

The above, helps to prevent sending stacktrace when first time requesting application with modified request.

Demo project: demo-15.zip (88.8 KB)

Regards,
Gleb