Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-5276

Cleanup method of request is not called

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 6.1.1
    • 6.2.0
    • None
    • None

    Description

      After upgrading to 6.1.1  we have noticed that cleanup method of custom 
      MultiPartRequest is not called by struts. 
       
       
      It may be related to 
      https://github.com/apache/struts/commit/69102e907551a87335231656320c8484072bdecb
       
      as before variable "request" was overwritten with wrapped request and cleanup was called in finally section
       
      After this commit new variable is created called "wrappedRequest", but cleanup is called only on original request, and new wrappedRequest is not cleaned up at all.
       
      Below is respective code fragment

      HttpServletRequest wrappedRequest = prepare.wrapRequest(request);
                          ActionMapping mapping = prepare.findActionMapping(wrappedRequest, response, true);
                          if (mapping == null) {
                              LOG.trace("Cannot find mapping for {}, passing to other filters", uri);
                              chain.doFilter(request, response);
                          } else {
                              LOG.trace("Found mapping {} for {}", mapping, uri);
                              execute.executeAction(wrappedRequest, response, mapping);
                          }
                      }
                  }
              } finally {
                  prepare.cleanupRequest(request);
              }

       
      This bug causes a lot of resource problems, and can result in denial of service condition for application  (or making application not compliant - as sensitive information is not properly discarded).
       
       
       
       
       
       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              mhankus Mirek Hankus
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h