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

Reduce logging for DMI excluded parameters

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.5.25
    • 6.0.0
    • Core
    • None

    Description

      There are unnecessary log warning when DMI is enabled, from the ParametersInterceptor.

      WARN com.opensymphony.xwork2.interceptor.ParametersInterceptor ParametersInterceptor:isAccepted - Parameter [action:myAction!save] didn't match accepted pattern [[\w+((\.\w+)|(\[\d+])|((\d+))|(['(\w|[\u4e00-\u9fa5])'])|(('(\w|[\u4e00-\u9fa5])')))*]]! See Accepted / Excluded patterns at https://struts.apache.org/security/#accepted--excluded-patterns

      eg the property 'action:myAction!save' should not be considered as a bean/property parameter, as its used as part of DMI to submit the form.

      Any property which matches the DMI method invocation "^(action|method):.*" needs to be silently ignored and not logged in devMode=true.

      DMI_AWARE_ACCEPTED_PATTERNS can also be dropped from DefaultAcceptedPatternsChecker as the DMI action|method would never be a form property.
      public static final String[] DMI_AWARE_ACCEPTED_PATTERNS =

      { "\\w+([:]?\\w+)?((\\.\\w+)|(\\[\\d+])|(\\(\\d+\\))|(\\['(\\w|[\\u4e00-\\u9fa5])+'])|(\\('(\\w|[\\u4e00-\\u9fa5])+'\\)))*([!]?\\w+)?" }

      ;

      Attachments

        Activity

          People

            lukaszlenart Lukasz Lenart
            ghuber Greg Huber
            Votes:
            0 Vote for this issue
            Watchers:
            4 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 - 3h 40m
                3h 40m