struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Maurizio Cucchiara (JIRA)" <>
Subject [jira] [Commented] (WW-4146) cache attack at OgnlUtil.expressions
Date Wed, 24 Jul 2013 14:25:49 GMT


Maurizio Cucchiara commented on WW-4146:

DOS attack could be valid expression,the point is don't cache expressions that inputed by
user,neither valid nor invalid.
Sorry, I don't agree here: the set of valid expressions is relatively small (remember that
I proposed to cache only **valid** parameter names, that is related to a existent java property),
and first or later (and also hopefully) they all will be cached.
> cache attack at  OgnlUtil.expressions
> -------------------------------------
>                 Key: WW-4146
>                 URL:
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Expression Language
>    Affects Versions:
>            Reporter: bruce liu
>             Fix For: 2.3.17
> 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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message