[ 
https://issues.apache.org/jira/browse/WW-4146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13996077#comment-13996077
 ] 

ASF GitHub Bot commented on WW-4146:
------------------------------------

GitHub user emeroad opened a pull request:

    https://github.com/apache/struts/pull/12

    [PATCH] WW-4146 Caches only valid Ognl expressions to avoid cache attack

     - duplicated cache put

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/emeroad/struts develop

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/struts/pull/12.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #12
    
----
commit 02a4cff4076e602a010fb232dfc76123f39e3b2d
Author: emeroad <emer...@hanmail.net>
Date:   2014-05-13T05:30:33Z

    [PATCH] WW-4146 Caches only valid Ognl expressions to avoid cache attack
     - duplicated cache put

----


> cache attack at  OgnlUtil.expressions
> -------------------------------------
>
>                 Key: WW-4146
>                 URL: https://issues.apache.org/jira/browse/WW-4146
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Expression Language
>    Affects Versions: 2.3.15.1
>            Reporter: bruce liu
>            Assignee: Lukasz Lenart
>             Fix For: 2.3.18
>
>         Attachments: WW-4146.patch
>
>
> in class com.opensymphony.xwork2.ognl.OgnlUtil, code :
> {code:java}
> tree = expressions.get(expression);
> if (tree == null) {
>       tree = Ognl.parseExpression(expression);
>       expressions.putIfAbsent(expression, tree);
> }
> {code}
> every parameter in the request cached in  field expressions  which is an 
> instances of ConcurrentMap<String, Object>, use parameterName as key. so i 
> construct huge different parameters that has different name (like  "abc[123], 
>  abc[124]" ), they all cached in  expressions, this cause outofmemory error, 
> and let map acted like a list .



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to