• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Low Low
    • 8.0.0
    • 8.0.0
    • Server - Platform

      Issue Summary

      The Struts request filter consumes the incoming request stream which prevents it from being consumed again.

      Currently only /rest/* is exempt from Struts request filtering - however plugins may only register servlets which map to /plugins/servlet/.

      Note: This was not an issue in Confluence 7 as WebWork was a mapped Servlet as opposed to a filter.

      Steps to Reproduce

      1. Create a servlet and attempt to consume multipart request stream

      Expected Results

      Read request stream

      Actual Results

      Unreadable

      Workaround

      N/A

          Form Name

            [CONFSERVER-80138] Plugins cannot opt out of Struts request filtering

            A fix for this issue is available in Confluence Server and Data Center 8.0.0.
            Upgrade now or check out the Release Notes to see what other issues are resolved.

            James Whitehead added a comment - A fix for this issue is available in Confluence Server and Data Center 8.0.0. Upgrade now or check out the Release Notes to see what other issues are resolved.

            deb4b4fcfa81 That's unusual, if you can reproduce this error in the upcoming EAP-17, I'd be interested to know the request url, dispatcher type and any other details you can provide.

            Kusal Kithul-Godage added a comment - deb4b4fcfa81 That's unusual, if you can reproduce this error in the upcoming EAP-17, I'd be interested to know the request url, dispatcher type and any other details you can provide.

            I'm seeing this in Confluence 8.0.0-m76, something about the order of execution of the StrutsPrepareFilter vs the StrutsExecuteFilter.

            I'm posting it here in case whoever is working on struts request filtering thinks this is related to their work.

            Not sure what action caused it, I'm testing my plugins in Confluence  9 EAP and while trying to figure out why one of my plugins won't deploy I ran into this:

            2022-10-18 19:17:39,659 ERROR [http-nio-8090-exec-1] [[Standalone].[localhost].[/].[default]] log Servlet.service() for servlet [default] in context with path [] threw exception
            java.lang.IllegalStateException: Must have the StrutsPrepareFilter execute before this one
                at org.apache.struts2.dispatcher.InitOperations.findDispatcherOnThread(InitOperations.java:98)
                at org.apache.struts2.dispatcher.filter.StrutsExecuteFilter.lazyInit(StrutsExecuteFilter.java:50)
                at org.apache.struts2.dispatcher.filter.StrutsExecuteFilter.doFilter(StrutsExecuteFilter.java:71)
                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
            
            ...
            
            java.lang.IllegalStateException: Must have the StrutsPrepareFilter execute before this one
                at org.apache.struts2.dispatcher.InitOperations.findDispatcherOnThread(InitOperations.java:98) ~[org.apache.struts_struts2-core-2.5.30-atlassian-3.jar:2.5.30-atlassian-3]
                at org.apache.struts2.dispatcher.filter.StrutsExecuteFilter.lazyInit(StrutsExecuteFilter.java:50) ~[org.apache.struts_struts2-core-2.5.30-atlassian-3.jar:2.5.30-atlassian-3]
                at org.apache.struts2.dispatcher.filter.StrutsExecuteFilter.doFilter(StrutsExecuteFilter.java:71) ~[org.apache.struts_struts2-core-2.5.30-atlassian-3.jar:2.5.30-atlassian-3]
                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) ~[catalina.jar:9.0.65]
                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[catalina.jar:9.0.65]
                at com.atlassian.confluence.util.AbstractBootstrapHotSwappingFilter$SwapOnBootstrapFilter.doFilter(AbstractBootstrapHotSwappingFilter.java:55) ~[com.atlassian.confluence_confluence-8.0.0-m76.jar:?]
                at com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:32) ~[com.atlassian.core_atlassian-core-8.0.0.jar:?]
                at com.atlassian.confluence.util.AbstractBootstrapHotSwappingFilter.doFilter(AbstractBootstrapHotSwappingFilter.java:35) ~[com.atlassian.confluence_confluence-8.0.0-m76.jar:?]
                at com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:32) ~[com.atlassian.core_atlassian-core-8.0.0.jar:?]
             

            Ture Hoefner {Appfire} added a comment - I'm seeing this in Confluence 8.0.0-m76, something about the order of execution of the StrutsPrepareFilter vs the StrutsExecuteFilter. I'm posting it here in case whoever is working on struts request filtering thinks this is related to their work. Not sure what action caused it, I'm testing my plugins in Confluence  9 EAP and while trying to figure out why one of my plugins won't deploy I ran into this: 2022-10-18 19:17:39,659 ERROR [http-nio-8090-exec-1] [[Standalone].[localhost].[/].[ default ]] log Servlet.service() for servlet [ default ] in context with path [] threw exception java.lang.IllegalStateException: Must have the StrutsPrepareFilter execute before this one     at org.apache.struts2.dispatcher.InitOperations.findDispatcherOnThread(InitOperations.java:98)     at org.apache.struts2.dispatcher.filter.StrutsExecuteFilter.lazyInit(StrutsExecuteFilter.java:50)     at org.apache.struts2.dispatcher.filter.StrutsExecuteFilter.doFilter(StrutsExecuteFilter.java:71)     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ... java.lang.IllegalStateException: Must have the StrutsPrepareFilter execute before this one     at org.apache.struts2.dispatcher.InitOperations.findDispatcherOnThread(InitOperations.java:98) ~[org.apache.struts_struts2-core-2.5.30-atlassian-3.jar:2.5.30-atlassian-3]     at org.apache.struts2.dispatcher.filter.StrutsExecuteFilter.lazyInit(StrutsExecuteFilter.java:50) ~[org.apache.struts_struts2-core-2.5.30-atlassian-3.jar:2.5.30-atlassian-3]     at org.apache.struts2.dispatcher.filter.StrutsExecuteFilter.doFilter(StrutsExecuteFilter.java:71) ~[org.apache.struts_struts2-core-2.5.30-atlassian-3.jar:2.5.30-atlassian-3]     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) ~[catalina.jar:9.0.65]     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[catalina.jar:9.0.65]     at com.atlassian.confluence.util.AbstractBootstrapHotSwappingFilter$SwapOnBootstrapFilter.doFilter(AbstractBootstrapHotSwappingFilter.java:55) ~[com.atlassian.confluence_confluence-8.0.0-m76.jar:?]     at com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:32) ~[com.atlassian.core_atlassian-core-8.0.0.jar:?]     at com.atlassian.confluence.util.AbstractBootstrapHotSwappingFilter.doFilter(AbstractBootstrapHotSwappingFilter.java:35) ~[com.atlassian.confluence_confluence-8.0.0-m76.jar:?]     at com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:32) ~[com.atlassian.core_atlassian-core-8.0.0.jar:?]

              854eef6f5746 Kusal Kithul-Godage
              854eef6f5746 Kusal Kithul-Godage
              Affected customers:
              0 This affects my team
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: