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

OgnlValueStack causes race condition

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.3.16.1
    • 2.3.20
    • Core Actions, Value Stack
    • None
    • Patch

    Description

      com.opensymphony.xwork2.ognl.accessor.CompoundRootAccessor.callMethod is not thread safe because of unsynchronized reads and writes to HashMap:

      private static Map invalidMethods = new HashMap();
      ...
      public Object callMethod(Map context, Object target, String name, Object[] objects) throws MethodFailedException {
          ...
          if ((argTypes == null) || !invalidMethods.containsKey(mc)) {
              ...
              invalidMethods.put(mc, Boolean.TRUE);
              ...
          }
          ...
      }
      

      Propose to use ConcurrentHashMap

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            lukaszlenart Lukasz Lenart
            sergey.gromov Sergey Gromov
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment