[ 
https://issues.apache.org/struts/browse/WW-2030?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_41379
 ] 

Andrea Vettori commented on WW-2030:
------------------------------------

For the second of the two problems, a simple test shows that the parameter 
value is passed "untouched" to the action class. So if <s:textfield 
name="xxx"/> and action has parameter xxx, if the user writes %{1+1} the string 
xxx into the action class contains %{1+1}. Sorry if it's obvious to you struts 
experts :)

So the evaluation that gives us a "2" in the textfield is run on the "view" 
part.

So I think we should be able to tell the view tag if the value expression must 
be evaluated recursively or not.
So <s:textfield name="xxx"/> that is "equivalent" to <s:textfield name="xxx" 
value="%{xxx}"/> when xxx is equal to "%{1+1}" should give us %{1+1} when NOT 
recursively evaluated or "2" when recursively evaluated.

We can use two different parameters (like value and valueeval). Or request 
recursive evaluation with a parameter receval="true".

We should also have a new param on 
com/opensymphony/xwork2/util/TextParseUtil.translateVariables to specify if we 
want recursive evaluation or not.

I don't have all the tools and knowledge needed to try to patch myself and 
recompile xwork but if someone can try I think this can be a good solution.


> DOS (continuos memory eating on an infinte loop) on form fields
> ---------------------------------------------------------------
>
>                 Key: WW-2030
>                 URL: https://issues.apache.org/struts/browse/WW-2030
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Value Stack
>    Affects Versions: 2.0.8
>            Reporter: Andrea Vettori
>            Priority: Critical
>         Attachments: Struts.diff, Struts2.diff, xwork.diff, xwork2.diff
>
>
> On a form with
> <s:textfield name="xxx">
> if the user enters %{xxx} as the value then 
> com/opensymphony/xwork2/util/TextParseUtil.translateVariables enters an 
> infinite loop eating about 1GB of ram in one second on my server.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to