You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Don Brown <do...@gmail.com> on 2007/07/16 08:55:40 UTC
Preventing OGNL evaluations of user input (was Re: Struts 2 performance)
If your application is displaying user input without checking for
malicious code, you have a problem whether Struts 2 evaluations ognl
expressions or not. This is how the majority of Cross-Site
Scripting (XSS) [1] attacks work, tricking the user into visiting a
page that the attacker has placed JavaScript that steals their
cookies.
That said, the average Struts developer may not be aware of how OGNL
is being used here, so we should do something to better protect the
application.
I'm taking this discussion over to the dev@ list.
Don
[1] http://en.wikipedia.org/wiki/Cross-site_scripting
On 7/16/07, Aram Mkhitaryan <ar...@googlemail.com> wrote:
> Maybe it's new just for me, but I found out one of the main reasons of the
> problem
>
> try to submit "%{@java.lang.System@exit(0)}" in the viewable property
> for example you submit a text, and it is displayed by s2's tags
>
> try and have fun ...
>
> this expression works and my server shuts down!
>
> the problem I mentioned is that when I say "print property" it executes it
> at first ...
> but it should not! I'm right, amn't I?
>
> why it executes the string value in my property?
> (it's not just a problem, it's a security risk, the users can hack s2 sites)
> (at least who may read this message will know that he can hack s2 sites and
> the simplest way is given above)
>
> that's why even when you do not use ognl expressions, it still works and it
> costs ...
>
> Best,
> Aram
> ________________________________
> Aram Mkhitaryan
>
> 52, 25 Lvovyan, Yerevan 375000, Armenia
>
> Mobile: +374 91 518456
> E-mail: aram.mkhitaryan@googlemail.com
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Preventing OGNL evaluations of user input (was Re: Struts 2 performance)
Posted by Antonio Petrelli <an...@gmail.com>.
2007/7/16, Aram Mkhitaryan <ar...@googlemail.com>:
>
> Should someone create a ticket in jira?
Yep.
https://issues.apache.org/struts/browse/WW-2030
Antonio
Re: Preventing OGNL evaluations of user input (was Re: Struts 2 performance)
Posted by Aram Mkhitaryan <ar...@googlemail.com>.
I think we both have to find out,
even better, to test which form works and does what ...
Thanks,
Aram
________________________________
Aram Mkhitaryan
52, 25 Lvovyan, Yerevan 375000, Armenia
Mobile: +374 91 518456
E-mail: aram.mkhitaryan@googlemail.com
Re: Preventing OGNL evaluations of user input (was Re: Struts 2 performance)
Posted by Antonio Petrelli <an...@gmail.com>.
2007/7/16, Ing. Andrea Vettori <ma...@andreavettori.com>:
>
> > so currently (without patches),
> > <s:property value="propName" /> just prints the "propName"
> > property, but
> > <s:property value="%{propName}" /> evaluates the expression in %{}
> > and if
> > propName=amout, it prints the "amout" property?
> >
>
> No, <s:property value="%{propName}"/> should be equivalent to
> <s:property value="propName"/>.
Mmm I think that I (me, myself) have to learn the basics of OGNL :-)
Sorry
Antonio
Re: Preventing OGNL evaluations of user input (was Re: Struts 2 performance)
Posted by Antonio Petrelli <an...@gmail.com>.
2007/7/16, Ing. Andrea Vettori <ma...@andreavettori.com>:
> No, <s:property value="%{propName}"/> should be equivalent to
> <s:property value="propName"/>.
If it is true, then if you have a field named "password" and the user
types "password" then it is evaluated as "%{password}", so you have an
infinite loop.
Andrea, this could be the cause of your memory leak. Or maybe I missed
something :-)
Antonio
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Preventing OGNL evaluations of user input (was Re: Struts 2 performance)
Posted by "Ing. Andrea Vettori" <ma...@andreavettori.com>.
>
> Sorry that I'm asking the same again, but this is the fastest way
> to know
> the truth
> so currently (without patches),
> <s:property value="propName" /> just prints the "propName"
> property, but
> <s:property value="%{propName}" /> evaluates the expression in %{}
> and if
> propName=amout, it prints the "amout" property?
>
No, <s:property value="%{propName}”/> should be equivalent to
<s:property value="propName"/>.
I think You'll get the second behaviour with <s:property value="%{%
{propName}}"/>
--
Ing. Andrea Vettori
Consulente per l'Information Technology
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Preventing OGNL evaluations of user input (was Re: Struts 2 performance)
Posted by Aram Mkhitaryan <ar...@googlemail.com>.
So the patch disables only evaluation of user submitted text,
but if I write expression in tags, that will work fine as before?
If this is true,
I think this is a good solution.
Sorry that I'm asking the same again, but this is the fastest way to know
the truth
so currently (without patches),
<s:property value="propName" /> just prints the "propName" property, but
<s:property value="%{propName}" /> evaluates the expression in %{} and if
propName=amout, it prints the "amout" property?
Best,
Aram
________________________________
Aram Mkhitaryan
52, 25 Lvovyan, Yerevan 375000, Armenia
Mobile: +374 91 518456
E-mail: aram.mkhitaryan@googlemail.com
Re: Preventing OGNL evaluations of user input (was Re: Struts 2 performance)
Posted by "Ing. Andrea Vettori" <ma...@andreavettori.com>.
The parameter is "removed" so it's like your input an empty string.
Il giorno 16/lug/07, alle ore 11:36, Aram Mkhitaryan ha scritto:
> Thanks for the response,
>
> so if I type in my text input %{..System.exit(0);} it will not shut my
> server down,
> but what will happen?
> will I get errors or just the text will not be evaluated?
>
> Best,
> Aram
> ________________________________
> Aram Mkhitaryan
>
> 52, 25 Lvovyan, Yerevan 375000, Armenia
>
> Mobile: +374 91 518456
> E-mail: aram.mkhitaryan@googlemail.com
--
Ing. Andrea Vettori
Consulente per l'Information Technology
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Preventing OGNL evaluations of user input (was Re: Struts 2 performance)
Posted by Aram Mkhitaryan <ar...@googlemail.com>.
Thanks for the response,
so if I type in my text input %{..System.exit(0);} it will not shut my
server down,
but what will happen?
will I get errors or just the text will not be evaluated?
Best,
Aram
________________________________
Aram Mkhitaryan
52, 25 Lvovyan, Yerevan 375000, Armenia
Mobile: +374 91 518456
E-mail: aram.mkhitaryan@googlemail.com
Re: Preventing OGNL evaluations of user input (was Re: Struts 2 performance)
Posted by "Ing. Andrea Vettori" <ma...@andreavettori.com>.
The patch works the only problem is if you need to accept %{xxx} as
legal input from your users.
To apply the patch you need to download xwork sources, apply the
patch (with the patch command or manually if you don't have it since
there are few lines of code) and insert a couple of lines on
struts.xml. Recompile xwork and
use that jar instead of the jar distributed with struts.
Il giorno 16/lug/07, alle ore 10:44, Aram Mkhitaryan ha scritto:
> Sorry guys for spamming, but it is not clear what the patch exactly
> resolves.
>
>> disallow entering possible malicious code, i.e. expression like %
>> {xxx} is
>> illegal: instead it should be evaluated as the string "%{xxx}".
> what means the first is illegal, but should be evaluated as the string
> could you please bring an example with <s:property tag?
>
> Best,
> Aram
>
> P.S. do you have a guide about "how to apply patches"?
> ________________________________
> Aram Mkhitaryan
>
> 52, 25 Lvovyan, Yerevan 375000, Armenia
>
> Mobile: +374 91 518456
> E-mail: aram.mkhitaryan@googlemail.com
--
Ing. Andrea Vettori
Consulente per l'Information Technology
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Preventing OGNL evaluations of user input (was Re: Struts 2 performance)
Posted by "Ing. Andrea Vettori" <ma...@andreavettori.com>.
Take a look at the jira issue, it's something I suggested too. We
should disable by default evaluation of expressions when they are an
input from the user (i.e. parameters to an action) and enable by
default expression when specified as parameters to tags.
Il giorno 16/lug/07, alle ore 11:29, Aram Mkhitaryan ha scritto:
> Actually that patch is not a solution, definitely.
>
> The solution could be:
> disable evaluation by default,
> add a hint to enable evaluation.
>
> for example
> old--- <s:property value="%{amount}" />
> solution--- <s:property value="eval/%{amount}" >
>
> i suggest this solution since
> <s:property value="%{amount}" />
> and
> <s:property value="amount" />
> should output the same. am I wrong?
> also because for the most of the cases just attribute values should be
> printed and not evaluated the content
> (note: the initial problem was the s2 performance)
>
> Best,
> Aram
> ________________________________
> Aram Mkhitaryan
>
> 52, 25 Lvovyan, Yerevan 375000, Armenia
>
> Mobile: +374 91 518456
> E-mail: aram.mkhitaryan@googlemail.com
--
Ing. Andrea Vettori
Consulente per l'Information Technology
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Preventing OGNL evaluations of user input (was Re: Struts 2 performance)
Posted by Antonio Petrelli <an...@gmail.com>.
2007/7/16, Aram Mkhitaryan <ar...@googlemail.com>:
>
> i suggest this solution since
> <s:property value="%{amount}" />
> and
> <s:property value="amount" />
> should output the same. am I wrong?
Definitely yes, I suggest you to learn the basics of OGNL :-)
And anyway, in JSP pages OGNL is ok: it is when user's inputs are used as
OGNL expressions that is wrong!.
Antonio
Re: Preventing OGNL evaluations of user input (was Re: Struts 2 performance)
Posted by Aram Mkhitaryan <ar...@googlemail.com>.
Actually that patch is not a solution, definitely.
The solution could be:
disable evaluation by default,
add a hint to enable evaluation.
for example
old--- <s:property value="%{amount}" />
solution--- <s:property value="eval/%{amount}" >
i suggest this solution since
<s:property value="%{amount}" />
and
<s:property value="amount" />
should output the same. am I wrong?
also because for the most of the cases just attribute values should be
printed and not evaluated the content
(note: the initial problem was the s2 performance)
Best,
Aram
________________________________
Aram Mkhitaryan
52, 25 Lvovyan, Yerevan 375000, Armenia
Mobile: +374 91 518456
E-mail: aram.mkhitaryan@googlemail.com
Re: Preventing OGNL evaluations of user input (was Re: Struts 2 performance)
Posted by Aram Mkhitaryan <ar...@googlemail.com>.
Sorry guys for spamming, but it is not clear what the patch exactly
resolves.
> disallow entering possible malicious code, i.e. expression like %{xxx} is
> illegal: instead it should be evaluated as the string "%{xxx}".
what means the first is illegal, but should be evaluated as the string
could you please bring an example with <s:property tag?
Best,
Aram
P.S. do you have a guide about "how to apply patches"?
________________________________
Aram Mkhitaryan
52, 25 Lvovyan, Yerevan 375000, Armenia
Mobile: +374 91 518456
E-mail: aram.mkhitaryan@googlemail.com
Re: Preventing OGNL evaluations of user input (was Re: Struts 2 performance)
Posted by Antonio Petrelli <an...@gmail.com>.
2007/7/16, Ing. Andrea Vettori <ma...@andreavettori.com>:
>
> It's already known and a patch already exists.
Well, in fact the patch does not prevent execution of OGNL commands, but
disallow entering possible malicious code, i.e. expression like %{xxx} is
illegal: instead it should be evaluated as the string "%{xxx}".
Antonio
Re: Preventing OGNL evaluations of user input (was Re: Struts 2 performance)
Posted by "Ing. Andrea Vettori" <ma...@andreavettori.com>.
It's already known and a patch already exists.
https://issues.apache.org/struts/browse/WW-2030
Don't know when a patched version will be released.
Il giorno 16/lug/07, alle ore 10:29, Aram Mkhitaryan ha scritto:
> Should someone create a ticket in jira?
>
> I guess it is really a huge problem.
>
> Best,
> Aram
> ________________________________
> Aram Mkhitaryan
>
> 52, 25 Lvovyan, Yerevan 375000, Armenia
>
> Mobile: +374 91 518456
> E-mail: aram.mkhitaryan@googlemail.com
--
Ing. Andrea Vettori
Consulente per l'Information Technology
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Preventing OGNL evaluations of user input (was Re: Struts 2 performance)
Posted by Aram Mkhitaryan <ar...@googlemail.com>.
Should someone create a ticket in jira?
I guess it is really a huge problem.
Best,
Aram
________________________________
Aram Mkhitaryan
52, 25 Lvovyan, Yerevan 375000, Armenia
Mobile: +374 91 518456
E-mail: aram.mkhitaryan@googlemail.com
Re: Preventing OGNL evaluations of user input (was Re: Struts 2 performance)
Posted by Jeromy Evans <je...@blueskyminds.com.au>.
Is there a policy or person in the struts2, webwork or apache team with
a PR role that's going to announce the vulnerability?
I'm obliged to keep my clients informed and I'd rather point them to a
factual article announced by the community than to a misinformed post
that will undoubtedly soon appear on theserverside.com, slashdot or a
vulnerability site.
Don Brown wrote:
> If your application is displaying user input without checking for
> malicious code, you have a problem whether Struts 2 evaluations ognl
> expressions or not. This is how the majority of Cross-Site
> Scripting (XSS) [1] attacks work, tricking the user into visiting a
> page that the attacker has placed JavaScript that steals their
> cookies.
>
> That said, the average Struts developer may not be aware of how OGNL
> is being used here, so we should do something to better protect the
> application.
>
> I'm taking this discussion over to the dev@ list.
>
> Don
>
> [1] http://en.wikipedia.org/wiki/Cross-site_scripting
>
> On 7/16/07, Aram Mkhitaryan <ar...@googlemail.com> wrote:
>> Maybe it's new just for me, but I found out one of the main reasons
>> of the
>> problem
>>
>> try to submit "%{@java.lang.System@exit(0)}" in the viewable property
>> for example you submit a text, and it is displayed by s2's tags
>>
>> try and have fun ...
>>
>> this expression works and my server shuts down!
>>
>> the problem I mentioned is that when I say "print property" it
>> executes it
>> at first ...
>> but it should not! I'm right, amn't I?
>>
>> why it executes the string value in my property?
>> (it's not just a problem, it's a security risk, the users can hack s2
>> sites)
>> (at least who may read this message will know that he can hack s2
>> sites and
>> the simplest way is given above)
>>
>> that's why even when you do not use ognl expressions, it still works
>> and it
>> costs ...
>>
>> Best,
>> Aram
>> ________________________________
>> Aram Mkhitaryan
>>
>> 52, 25 Lvovyan, Yerevan 375000, Armenia
>>
>> Mobile: +374 91 518456
>> E-mail: aram.mkhitaryan@googlemail.com
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Preventing OGNL evaluations of user input (was Re: Struts 2 performance)
Posted by Antonio Petrelli <an...@gmail.com>.
2007/7/24, Roberto Nunnari <ro...@supsi.ch>:
>
> I see it also includes Tiles 2.0.4.. that should also include
> the fix for the contentType of the response not set bug present
> in version 2.0.3
Yep! Confirmed :-)
Antonio
Re: Preventing OGNL evaluations of user input (was Re: Struts 2 performance)
Posted by Roberto Nunnari <ro...@supsi.ch>.
I see it also includes Tiles 2.0.4.. that should also include
the fix for the contentType of the response not set bug present
in version 2.0.3
--
Robi
Ted Husted wrote:
> For those of you following this thread, a test build for Struts 2.0.9
> is available. Unless a problem is found, we expect to upgrade the
> quality to a GA release by tomorrow evening, once the distribution has
> had time to propagate through the mirroring network. Another quick-fix
> to the OGNL expression issue is to replace a prior version of XWork2
> with XWork 2.0.4.
>
> * http://www.opensymphony.com/xwork/download.action
>
> ---------- Forwarded message ----------
> From: Ted Husted <hu...@apache.org>
> Date: Jul 23, 2007 4:31 PM
> Subject: Re: Struts 2.0.9 release (was Re: S2 security fix release
> planning (XWork 2.0.4 is out))
> To: Struts Developers List <de...@struts.apache.org>
>
>
> The test build of Struts 2.0.9 is available.
>
> Release notes:
>
> * http://struts.apache.org/2.x/docs/release-notes-209.html
>
> Distribution:
>
> * http://people.apache.org/builds/struts/2.0.9/
>
> Maven 2 staging repository:
>
> *
> http://people.apache.org/builds/struts/2.0.9/m2-staging-repository/
>
> We appreciate the time and effort everyone has put toward contributing
> code and documentation, posting to the mailing lists, and logging
> issues.
>
> Once you have had a chance to review the test build, please respond
> with a vote on its quality:
>
> [ ] Leave at test build
> [ ] Alpha
> [ ] Beta
> [ ] General Availability (GA)
>
> Everyone who has tested the build is invited to vote. Votes by PMC
> members are considered binding. A vote passes if there are at least
> three binding +1s and more +1s than -1s.
>
> **** PLEASE NOTE ****
>
> In the interest of time, I would like to declare a quality grade on
> Struts 2.0.9 AS SOON AS we have received three binding votes toward
> one of the grades, and NOT WAIT the usual 72 hours!
>
> If not voting GA, please also be specific as to your concerns, so that
> we can address any issues immediately!
>
> Remember, a vote can be amended at any time to upgrade or downgrade
> the quality of the release based on future experience. If an initial
> vote designates the build as "Beta", the release will be submitted for
> mirroring and announced to the user list. Once released as a public
> beta, subsequent quality votes on a build may be held on the user
> list.
>
> As always, the act of voting carries certain obligations. A binding
> vote not only states an opinion, but means that the voter is agreeing
> to help do the work
>
> -Ted.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Preventing OGNL evaluations of user input (was Re: Struts 2 performance)
Posted by Ted Husted <hu...@apache.org>.
For those of you following this thread, a test build for Struts 2.0.9
is available. Unless a problem is found, we expect to upgrade the
quality to a GA release by tomorrow evening, once the distribution has
had time to propagate through the mirroring network. Another quick-fix
to the OGNL expression issue is to replace a prior version of XWork2
with XWork 2.0.4.
* http://www.opensymphony.com/xwork/download.action
---------- Forwarded message ----------
From: Ted Husted <hu...@apache.org>
Date: Jul 23, 2007 4:31 PM
Subject: Re: Struts 2.0.9 release (was Re: S2 security fix release
planning (XWork 2.0.4 is out))
To: Struts Developers List <de...@struts.apache.org>
The test build of Struts 2.0.9 is available.
Release notes:
* http://struts.apache.org/2.x/docs/release-notes-209.html
Distribution:
* http://people.apache.org/builds/struts/2.0.9/
Maven 2 staging repository:
* http://people.apache.org/builds/struts/2.0.9/m2-staging-repository/
We appreciate the time and effort everyone has put toward contributing
code and documentation, posting to the mailing lists, and logging
issues.
Once you have had a chance to review the test build, please respond
with a vote on its quality:
[ ] Leave at test build
[ ] Alpha
[ ] Beta
[ ] General Availability (GA)
Everyone who has tested the build is invited to vote. Votes by PMC
members are considered binding. A vote passes if there are at least
three binding +1s and more +1s than -1s.
**** PLEASE NOTE ****
In the interest of time, I would like to declare a quality grade on
Struts 2.0.9 AS SOON AS we have received three binding votes toward
one of the grades, and NOT WAIT the usual 72 hours!
If not voting GA, please also be specific as to your concerns, so that
we can address any issues immediately!
Remember, a vote can be amended at any time to upgrade or downgrade
the quality of the release based on future experience. If an initial
vote designates the build as "Beta", the release will be submitted for
mirroring and announced to the user list. Once released as a public
beta, subsequent quality votes on a build may be held on the user
list.
As always, the act of voting carries certain obligations. A binding
vote not only states an opinion, but means that the voter is agreeing
to help do the work
-Ted.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Preventing OGNL evaluations of user input (was Re: Struts 2 performance)
Posted by Don Brown <do...@gmail.com>.
I have replied in dev@ so please post over there. Thanks,
Don
On 7/16/07, Aram Mkhitaryan <ar...@googlemail.com> wrote:
> Don, could you please send the subject to continue the discussion in?
> Should we use dev@struts.apache.org?
>
> Thanks,
> Aram
> ________________________________
> Aram Mkhitaryan
>
> 52, 25 Lvovyan, Yerevan 375000, Armenia
>
> Mobile: +374 91 518456
> E-mail: aram.mkhitaryan@googlemail.com
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Preventing OGNL evaluations of user input (was Re: Struts 2 performance)
Posted by Antonio Petrelli <an...@gmail.com>.
2007/7/16, Aram Mkhitaryan <ar...@googlemail.com>:
>
> everywhere in s2 tags the user submitted values should not be evaluated
> till
> it is not requested
> with a method call like "eval(ognlString)" otherwise it should not work
I disagree. Whatever the user types in the fields, it MUST NOT be evaluated,
otherwise we will always have a security issue.
The only thing that could be done is type conversion (e.g. String->int).
Antonio
Re: Preventing OGNL evaluations of user input (was Re: Struts 2 performance)
Posted by Aram Mkhitaryan <ar...@googlemail.com>.
As a user I would like to know exactly that everything is clear and secure.
>From my point of view I do not need to know about parameter filters and
stuff like that.
If it is not changing much, it would be nice to have the following behavior
:
everywhere in s2 tags the user submitted values should not be evaluated till
it is not requested
with a method call like "eval(ognlString)" otherwise it should not work
also when I write "propertyName" not "%{propertyName}" then the processor
should manage that
like jps's expression language does, I mean no evaluation, just the simplest
and the fastest solution
this will solve a lot of problems:
1. performance, if the processor isnot forced to evaluate ognl tags (by %{}
form) it will not do and it will save time
2. security, if it is not forced (eval method), the processor will not
evaluate the user submitted data
if it is possible and it does not invalidate s2's ideas and principals,
please implement changes in this way
Thank you in advance,
Aram
________________________________
Aram Mkhitaryan
52, 25 Lvovyan, Yerevan 375000, Armenia
Mobile: +374 91 518456
E-mail: aram.mkhitaryan@googlemail.com
Re: Preventing OGNL evaluations of user input (was Re: Struts 2 performance)
Posted by Musachy Barroso <mu...@gmail.com>.
In that case I take it back :)
musachy
On 7/16/07, Don Brown <mr...@twdata.org> wrote:
>
> From my tests, recursion is never really used and is just a byproduct of
> how
> the text parsing algorithm works. I improved the algorithm to be able to
> detect and selectively enable recursion, although it is off by default.
> Having done that, all XWork and Struts 2 tests still passed, so I'm fairly
> confident most, if not all, WW/S2 applications should be ok.
>
> Don
>
> On 7/16/07, Musachy Barroso <mu...@gmail.com> wrote:
> >
> > I wouldn't agree that's a good solution, as it will be more difficult
> for
> > users to understand, they will have to remember the enable/disable the
> > recursion with serious problems if they don't, and questions will be
> asked
> > by the thousands on the mailing list :). On top of that it will break
> > backward compatibility big time.
> >
> > The only drawback of preventing the evaluation of parameters is that if
> > someone is trying to pass a parameter in the form %{...}, it won't work,
> > which most likely nobody is doing, and if they have to, they could
> escape
> > it
> > to %\{...\} or something else.
> >
> > musachy
> >
> > On 7/16/07, Don Brown <mr...@twdata.org> wrote:
> > >
> > > I think the real solution is in fixing the recursive processing of
> text.
> > > I'm working on a patch that will ensure the 'value' attribute isn't
> > > processed recursively, thereby, resolving our issue. The question
> then
> > is
> > > to turn recursive processing on by default or not. If not and we make
> a
> > > special case for the 'value' attribute, it could still be possible for
> > the
> > > user to shoot themselves in the foot by creating a localisation
> message
> > > such
> > > as:
> > >
> > > The name needs at least %{minSize} characters
> > >
> > > Then, the attacker just needs to submit a form with a field like:
> > >
> > > <input type="hidden" name="minSize" value="%{@java.lang.System@exit
> (0)}"
> > > />
> > >
> > > This happens because the form parameters are on the top of the stack
> > > usually.
> > >
> > > Therefore, the safest solution is to turn recursive processing off by
> > > default and selectively allow a user to allow recursion through an
> extra
> > > tag
> > > attribute or similar means. However, that will definitely break
> > existing
> > > apps, where only turning recursion off for the 'value' attribute has a
> > > much
> > > smaller chance of breaking apps.
> > >
> > > Don
> > >
> > > On 7/16/07, Martin Gilday <ma...@imap.cc> wrote:
> > > >
> > > > As has been said the current fix is not ideal. The changes that
> have
> > > > been made to params interceptor mean that the functionality in
> > > > ParamsInterceptor and ParamFilterInterceptor are now very similar,
> > > > except one supports regex. Would it be worthwile trying to combine
> > > > these now that it is apparent they are crucial to security? With
> this
> > > > fix there is the danger now that as soon as anyone adds in there own
> > > > "excludePattern" they can remove the default which is preventing the
> > > > ognl hack, without realising the problem they are creating.
> > > >
> > > >
> > > > ----- Original message -----
> > > > From: "Don Brown" <do...@gmail.com>
> > > > To: "Struts Developers List" <de...@struts.apache.org>
> > > > Date: Mon, 16 Jul 2007 21:49:15 +1000
> > > > Subject: Re: Preventing OGNL evaluations of user input (was Re:
> Struts
> > 2
> > > > performance)
> > > >
> > > > Continuing in dev@ ...
> > > >
> > > > On 7/16/07, Aram Mkhitaryan <ar...@googlemail.com> wrote:
> > > > > Don, could you please send the subject to continue the discussion
> > in?
> > > > > Should we use dev@struts.apache.org?
> > > > >
> > > > > Thanks,
> > > > > Aram
> > > > > ________________________________
> > > > > Aram Mkhitaryan
> > > > >
> > > > > 52, 25 Lvovyan, Yerevan 375000, Armenia
> > > > >
> > > > > Mobile: +374 91 518456
> > > > > E-mail: aram.mkhitaryan@googlemail.com
> > > > >
> > > >
> > > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> > > > For additional commands, e-mail: dev-help@struts.apache.org
> > > >
> > > >
> > > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> > > > For additional commands, e-mail: dev-help@struts.apache.org
> > > >
> > > >
> > >
> >
> >
> >
> > --
> > "Hey you! Would you help me to carry the stone?" Pink Floyd
> >
>
--
"Hey you! Would you help me to carry the stone?" Pink Floyd
Re: Preventing OGNL evaluations of user input (was Re: Struts 2 performance)
Posted by "Ing. Andrea Vettori" <ma...@andreavettori.com>.
At a first look (but haven't tried because I don't have a compiler
here :) that kind of expression is correctly evaluated by Don patch.
The only thing is that evaluation order is changed.
The actual version evaluates always left to right in only one pass.
So it is like depth-first recursion.
Don patch seems to evaluate on many runs from left to right and
evaluating all expression at the same level first (don't remember the
name for this type of recursion :)
Il giorno 16/lug/07, alle ore 16:21, Musachy Barroso ha scritto:
> I do use it
>
> musachy
>
> On 7/16/07, Ing. Andrea Vettori <ma...@andreavettori.com> wrote:
>>
>> What about expression like "%{foo} %{bar}" that work with the current
>> version but don't work using the loopCounter patch ?
>>
>> I don't think we need them but who knows...
>>
>>
>> Il giorno 16/lug/07, alle ore 15:38, Don Brown ha scritto:
>>
>> > From my tests, recursion is never really used and is just a
>> > byproduct of how
>> > the text parsing algorithm works. I improved the algorithm to be
>> > able to
>> > detect and selectively enable recursion, although it is off by
>> > default.
>> > Having done that, all XWork and Struts 2 tests still passed, so I'm
>> > fairly
>> > confident most, if not all, WW/S2 applications should be ok.
>> >
>> > Don
>> >
>> > On 7/16/07, Musachy Barroso <mu...@gmail.com> wrote:
>> >>
>> >> I wouldn't agree that's a good solution, as it will be more
>> >> difficult for
>> >> users to understand, they will have to remember the enable/disable
>> >> the
>> >> recursion with serious problems if they don't, and questions will
>> >> be asked
>> >> by the thousands on the mailing list :). On top of that it will
>> break
>> >> backward compatibility big time.
>> >>
>> >> The only drawback of preventing the evaluation of parameters is
>> >> that if
>> >> someone is trying to pass a parameter in the form %{...}, it won't
>> >> work,
>> >> which most likely nobody is doing, and if they have to, they could
>> >> escape
>> >> it
>> >> to %\{...\} or something else.
>> >>
>> >> musachy
>> >>
>> >> On 7/16/07, Don Brown <mr...@twdata.org> wrote:
>> >> >
>> >> > I think the real solution is in fixing the recursive processing
>> >> of text.
>> >> > I'm working on a patch that will ensure the 'value' attribute
>> isn't
>> >> > processed recursively, thereby, resolving our issue. The
>> >> question then
>> >> is
>> >> > to turn recursive processing on by default or not. If not and
>> >> we make a
>> >> > special case for the 'value' attribute, it could still be
>> >> possible for
>> >> the
>> >> > user to shoot themselves in the foot by creating a localisation
>> >> message
>> >> > such
>> >> > as:
>> >> >
>> >> > The name needs at least %{minSize} characters
>> >> >
>> >> > Then, the attacker just needs to submit a form with a field
>> like:
>> >> >
>> >> > <input type="hidden" name="minSize" value="%
>> >> {@java.lang.System@exit(0)}"
>> >> > />
>> >> >
>> >> > This happens because the form parameters are on the top of the
>> >> stack
>> >> > usually.
>> >> >
>> >> > Therefore, the safest solution is to turn recursive processing
>> >> off by
>> >> > default and selectively allow a user to allow recursion through
>> >> an extra
>> >> > tag
>> >> > attribute or similar means. However, that will definitely break
>> >> existing
>> >> > apps, where only turning recursion off for the 'value' attribute
>> >> has a
>> >> > much
>> >> > smaller chance of breaking apps.
>> >> >
>> >> > Don
>> >> >
>> >> > On 7/16/07, Martin Gilday <ma...@imap.cc> wrote:
>> >> > >
>> >> > > As has been said the current fix is not ideal. The changes
>> >> that have
>> >> > > been made to params interceptor mean that the functionality in
>> >> > > ParamsInterceptor and ParamFilterInterceptor are now very
>> >> similar,
>> >> > > except one supports regex. Would it be worthwile trying to
>> >> combine
>> >> > > these now that it is apparent they are crucial to security?
>> >> With this
>> >> > > fix there is the danger now that as soon as anyone adds in
>> >> there own
>> >> > > "excludePattern" they can remove the default which is
>> >> preventing the
>> >> > > ognl hack, without realising the problem they are creating.
>> >> > >
>> >> > >
>> >> > > ----- Original message -----
>> >> > > From: "Don Brown" <do...@gmail.com>
>> >> > > To: "Struts Developers List" <de...@struts.apache.org>
>> >> > > Date: Mon, 16 Jul 2007 21:49:15 +1000
>> >> > > Subject: Re: Preventing OGNL evaluations of user input (was
>> >> Re: Struts
>> >> 2
>> >> > > performance)
>> >> > >
>> >> > > Continuing in dev@ ...
>> >> > >
>> >> > > On 7/16/07, Aram Mkhitaryan <ar...@googlemail.com>
>> >> wrote:
>> >> > > > Don, could you please send the subject to continue the
>> >> discussion
>> >> in?
>> >> > > > Should we use dev@struts.apache.org?
>> >> > > >
>> >> > > > Thanks,
>> >> > > > Aram
>> >> > > > ________________________________
>> >> > > > Aram Mkhitaryan
>> >> > > >
>> >> > > > 52, 25 Lvovyan, Yerevan 375000, Armenia
>> >> > > >
>> >> > > > Mobile: +374 91 518456
>> >> > > > E-mail: aram.mkhitaryan@googlemail.com
>> >> > > >
>> >> > >
>> >> > >
>> >>
>> ---------------------------------------------------------------------
>> >> > > To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
>> >> > > For additional commands, e-mail: dev-help@struts.apache.org
>> >> > >
>> >> > >
>> >> > >
>> >>
>> ---------------------------------------------------------------------
>> >> > > To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
>> >> > > For additional commands, e-mail: dev-help@struts.apache.org
>> >> > >
>> >> > >
>> >> >
>> >>
>> >>
>> >>
>> >> --
>> >> "Hey you! Would you help me to carry the stone?" Pink Floyd
>> >>
>>
>> --
>> Ing. Andrea Vettori
>> Consulente per l'Information Technology
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
>> For additional commands, e-mail: dev-help@struts.apache.org
>>
>>
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
--
Ing. Andrea Vettori
Consulente per l'Information Technology
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: Preventing OGNL evaluations of user input (was Re: Struts 2 performance)
Posted by Musachy Barroso <mu...@gmail.com>.
I do use it
musachy
On 7/16/07, Ing. Andrea Vettori <ma...@andreavettori.com> wrote:
>
> What about expression like "%{foo} %{bar}" that work with the current
> version but don't work using the loopCounter patch ?
>
> I don't think we need them but who knows...
>
>
> Il giorno 16/lug/07, alle ore 15:38, Don Brown ha scritto:
>
> > From my tests, recursion is never really used and is just a
> > byproduct of how
> > the text parsing algorithm works. I improved the algorithm to be
> > able to
> > detect and selectively enable recursion, although it is off by
> > default.
> > Having done that, all XWork and Struts 2 tests still passed, so I'm
> > fairly
> > confident most, if not all, WW/S2 applications should be ok.
> >
> > Don
> >
> > On 7/16/07, Musachy Barroso <mu...@gmail.com> wrote:
> >>
> >> I wouldn't agree that's a good solution, as it will be more
> >> difficult for
> >> users to understand, they will have to remember the enable/disable
> >> the
> >> recursion with serious problems if they don't, and questions will
> >> be asked
> >> by the thousands on the mailing list :). On top of that it will break
> >> backward compatibility big time.
> >>
> >> The only drawback of preventing the evaluation of parameters is
> >> that if
> >> someone is trying to pass a parameter in the form %{...}, it won't
> >> work,
> >> which most likely nobody is doing, and if they have to, they could
> >> escape
> >> it
> >> to %\{...\} or something else.
> >>
> >> musachy
> >>
> >> On 7/16/07, Don Brown <mr...@twdata.org> wrote:
> >> >
> >> > I think the real solution is in fixing the recursive processing
> >> of text.
> >> > I'm working on a patch that will ensure the 'value' attribute isn't
> >> > processed recursively, thereby, resolving our issue. The
> >> question then
> >> is
> >> > to turn recursive processing on by default or not. If not and
> >> we make a
> >> > special case for the 'value' attribute, it could still be
> >> possible for
> >> the
> >> > user to shoot themselves in the foot by creating a localisation
> >> message
> >> > such
> >> > as:
> >> >
> >> > The name needs at least %{minSize} characters
> >> >
> >> > Then, the attacker just needs to submit a form with a field like:
> >> >
> >> > <input type="hidden" name="minSize" value="%
> >> {@java.lang.System@exit(0)}"
> >> > />
> >> >
> >> > This happens because the form parameters are on the top of the
> >> stack
> >> > usually.
> >> >
> >> > Therefore, the safest solution is to turn recursive processing
> >> off by
> >> > default and selectively allow a user to allow recursion through
> >> an extra
> >> > tag
> >> > attribute or similar means. However, that will definitely break
> >> existing
> >> > apps, where only turning recursion off for the 'value' attribute
> >> has a
> >> > much
> >> > smaller chance of breaking apps.
> >> >
> >> > Don
> >> >
> >> > On 7/16/07, Martin Gilday <ma...@imap.cc> wrote:
> >> > >
> >> > > As has been said the current fix is not ideal. The changes
> >> that have
> >> > > been made to params interceptor mean that the functionality in
> >> > > ParamsInterceptor and ParamFilterInterceptor are now very
> >> similar,
> >> > > except one supports regex. Would it be worthwile trying to
> >> combine
> >> > > these now that it is apparent they are crucial to security?
> >> With this
> >> > > fix there is the danger now that as soon as anyone adds in
> >> there own
> >> > > "excludePattern" they can remove the default which is
> >> preventing the
> >> > > ognl hack, without realising the problem they are creating.
> >> > >
> >> > >
> >> > > ----- Original message -----
> >> > > From: "Don Brown" <do...@gmail.com>
> >> > > To: "Struts Developers List" <de...@struts.apache.org>
> >> > > Date: Mon, 16 Jul 2007 21:49:15 +1000
> >> > > Subject: Re: Preventing OGNL evaluations of user input (was
> >> Re: Struts
> >> 2
> >> > > performance)
> >> > >
> >> > > Continuing in dev@ ...
> >> > >
> >> > > On 7/16/07, Aram Mkhitaryan <ar...@googlemail.com>
> >> wrote:
> >> > > > Don, could you please send the subject to continue the
> >> discussion
> >> in?
> >> > > > Should we use dev@struts.apache.org?
> >> > > >
> >> > > > Thanks,
> >> > > > Aram
> >> > > > ________________________________
> >> > > > Aram Mkhitaryan
> >> > > >
> >> > > > 52, 25 Lvovyan, Yerevan 375000, Armenia
> >> > > >
> >> > > > Mobile: +374 91 518456
> >> > > > E-mail: aram.mkhitaryan@googlemail.com
> >> > > >
> >> > >
> >> > >
> >> ---------------------------------------------------------------------
> >> > > To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> >> > > For additional commands, e-mail: dev-help@struts.apache.org
> >> > >
> >> > >
> >> > >
> >> ---------------------------------------------------------------------
> >> > > To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> >> > > For additional commands, e-mail: dev-help@struts.apache.org
> >> > >
> >> > >
> >> >
> >>
> >>
> >>
> >> --
> >> "Hey you! Would you help me to carry the stone?" Pink Floyd
> >>
>
> --
> Ing. Andrea Vettori
> Consulente per l'Information Technology
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>
--
"Hey you! Would you help me to carry the stone?" Pink Floyd
RE: Preventing OGNL evaluations of user input (was Re: Struts 2
performance)
Posted by Rainer Hermanns <he...@aixcept.de>.
Hi,
The security fix release for XWork2 is currently in progress and should be
available within the next 24hours. As soon as XWork2 is released, we can
start with the S2 release process. Cause this is really a bug in XWork, we
need to wait for that release.
In the meantime you might want to continue with a SNAPSHOT build of XWork2
available here:
http://maven.opensymphony.com/opensymphony/jars/xwork-2.0.4-SNAPSHOT.jar
This XWork2 release already contains the required patches and should resolve
the issue.
tia,
Rainer
> Hi Ted,
>
> I would have thought with this being such a potentially bad bug that you
> would release a new version?
>
> That means checking out everything. It gives a warning that it is a lot
> of data. Do you know how large it is approximately.
>
> Or could you possibly do a build for us and put a binary somewhere for
> us to access please.
>
> Thanks
>
> Dave.
>
> -----Original Message-----
> From: ted.husted@gmail.com [mailto:ted.husted@gmail.com] On Behalf Of
> Ted Husted
> Sent: 18 July 2007 12:24
> To: Struts Developers List
> Subject: Re: Preventing OGNL evaluations of user input (was Re: Struts 2
> performance)
>
> SVN.
>
> * http://struts.apache.org/dev/builds.html
>
> Unfortunately, the nightly builds aren't working right now, so to try
> the changes the only alternative right now is to build the HEAD from
> source.
>
> -Ted.
>
> On 7/18/07, Aram Mkhitaryan <ar...@googlemail.com> wrote:
>> In the give link it is written that to get changes I have to get the
>> latest version.
>>
>> Where can I get that version from? (fro SVN? or it is in 2.0.8?)
>>
>> Thanks,
>> Aram
>> ________________________________
>> Aram Mkhitaryan
>>
>> 52, 25 Lvovyan, Yerevan 375000, Armenia
>>
>> Mobile: +374 91 518456
>> E-mail: aram.mkhitaryan@googlemail.com
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org For additional
> commands, e-mail: dev-help@struts.apache.org
>
>
> - ------
> ML {UFI}
>
> ______________________________________________________________________
> Ufi Limited
> Registered in England No. 3980770
> Registered Office: Dearing House, 1 Young Street, Sheffield, S1 4UP
>
> learndirect Solutions Ltd
> Registered in England No. 5081669
> Registered Office: Dearing House, 1 Young Street, Sheffield, S1 4UP
>
> UFI Charitable Trust
> Registered in England No. 3658378
> Registered Charity No. 1081028
> Registered Office: Dearing House, 1 Young Street, Sheffield, S1 4UP
>
> This email has been scanned by the MessageLabs Email Security System.
>
> ______________________________________________________________________
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>
--
Rainer Hermanns
aixcept
Neupforte 16
52062 Aachen - Germany
w: http://aixcept.de/
t: +49-241-4012247
m: +49-170-3432912
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
RE: Preventing OGNL evaluations of user input (was Re: Struts 2 performance)
Posted by David Harland <dh...@ufi.com>.
Hi Ted,
I would have thought with this being such a potentially bad bug that you
would release a new version?
That means checking out everything. It gives a warning that it is a lot
of data. Do you know how large it is approximately.
Or could you possibly do a build for us and put a binary somewhere for
us to access please.
Thanks
Dave.
-----Original Message-----
From: ted.husted@gmail.com [mailto:ted.husted@gmail.com] On Behalf Of
Ted Husted
Sent: 18 July 2007 12:24
To: Struts Developers List
Subject: Re: Preventing OGNL evaluations of user input (was Re: Struts 2
performance)
SVN.
* http://struts.apache.org/dev/builds.html
Unfortunately, the nightly builds aren't working right now, so to try
the changes the only alternative right now is to build the HEAD from
source.
-Ted.
On 7/18/07, Aram Mkhitaryan <ar...@googlemail.com> wrote:
> In the give link it is written that to get changes I have to get the
> latest version.
>
> Where can I get that version from? (fro SVN? or it is in 2.0.8?)
>
> Thanks,
> Aram
> ________________________________
> Aram Mkhitaryan
>
> 52, 25 Lvovyan, Yerevan 375000, Armenia
>
> Mobile: +374 91 518456
> E-mail: aram.mkhitaryan@googlemail.com
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org For additional
commands, e-mail: dev-help@struts.apache.org
- ------
ML {UFI}
______________________________________________________________________
Ufi Limited
Registered in England No. 3980770
Registered Office: Dearing House, 1 Young Street, Sheffield, S1 4UP
learndirect Solutions Ltd
Registered in England No. 5081669
Registered Office: Dearing House, 1 Young Street, Sheffield, S1 4UP
UFI Charitable Trust
Registered in England No. 3658378
Registered Charity No. 1081028
Registered Office: Dearing House, 1 Young Street, Sheffield, S1 4UP
This email has been scanned by the MessageLabs Email Security System.
______________________________________________________________________
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: Preventing OGNL evaluations of user input (was Re: Struts 2 performance)
Posted by Ted Husted <hu...@apache.org>.
SVN.
* http://struts.apache.org/dev/builds.html
Unfortunately, the nightly builds aren't working right now, so to try
the changes the only alternative right now is to build the HEAD from
source.
-Ted.
On 7/18/07, Aram Mkhitaryan <ar...@googlemail.com> wrote:
> In the give link it is written that to get changes I have to get the latest
> version.
>
> Where can I get that version from? (fro SVN? or it is in 2.0.8?)
>
> Thanks,
> Aram
> ________________________________
> Aram Mkhitaryan
>
> 52, 25 Lvovyan, Yerevan 375000, Armenia
>
> Mobile: +374 91 518456
> E-mail: aram.mkhitaryan@googlemail.com
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: Preventing OGNL evaluations of user input (was Re: Struts 2 performance)
Posted by Aram Mkhitaryan <ar...@googlemail.com>.
In the give link it is written that to get changes I have to get the latest
version.
Where can I get that version from? (fro SVN? or it is in 2.0.8?)
Thanks,
Aram
________________________________
Aram Mkhitaryan
52, 25 Lvovyan, Yerevan 375000, Armenia
Mobile: +374 91 518456
E-mail: aram.mkhitaryan@googlemail.com
Re: Preventing OGNL evaluations of user input (was Re: Struts 2 performance)
Posted by Antonio Petrelli <an...@gmail.com>.
2007/7/17, Aram Mkhitaryan <ar...@googlemail.com>:
>
> I mean if I have myOgnlExpression(%{'property'+2}) in value stack,
>
> according to the latest changes %{myOgnlExpression} will print
> "%{'property'+2}"
> but what if that expression is not client side defined, but site
> administrator/developer defined and id should be executed???
> but if we have %{eval(myOgnlExpression)} it may print for example "welcome
> to ..." (the value of property2)
It's different: the evaluation will be executed server-side in a controlled
environment. In other words, you have to follow these steps:
1. accept the expression from the client;
2. store the expression somewhere (such as a DB);
3. when it is necessary, it is evaluated.
Currently the security hole does:
1. accept the expression from the client;
2. evaluate and store the result in the server.
This is a bug.
Antonio
Re: Preventing OGNL evaluations of user input (was Re: Struts 2 performance)
Posted by Aram Mkhitaryan <ar...@googlemail.com>.
I mean if I have myOgnlExpression(%{'property'+2}) in value stack,
according to the latest changes %{myOgnlExpression} will print
"%{'property'+2}"
but what if that expression is not client side defined, but site
administrator/developer defined and id should be executed???
but if we have %{eval(myOgnlExpression)} it may print for example "welcome
to ..." (the value of property2)
Best,
Aram
________________________________
Aram Mkhitaryan
52, 25 Lvovyan, Yerevan 375000, Armenia
Mobile: +374 91 518456
E-mail: aram.mkhitaryan@googlemail.com
Re: Preventing OGNL evaluations of user input (was Re: Struts 2 performance)
Posted by Aram Mkhitaryan <ar...@googlemail.com>.
>I 100% agree on this. I don't see any good reasons for evaluating the
>strings entered from the client side of the app.
I donot agree,
maybe I have defined ognl expressions in a property file or db and I want to
evaluate those expressions,
but values of my variables will be considered as a string entered from the
client side
I have to repeat my suggestion about the new "eval" method in ognl
expressions which will force the evaluation
Thank you in advance,
Aram
________________________________
Aram Mkhitaryan
52, 25 Lvovyan, Yerevan 375000, Armenia
Mobile: +374 91 518456
E-mail: aram.mkhitaryan@googlemail.com
Re: Preventing OGNL evaluations of user input (was Re: Struts 2 performance)
Posted by Antonio Petrelli <an...@gmail.com>.
2007/7/16, Martin Cooper <ma...@apache.org>:
> On 7/16/07, Don Brown <mr...@twdata.org> wrote:
> >
> > I've added a security bulletin to our official Struts 2 documentation to
> > begin to formalize this issue and its solution:
> >
> > http://cwiki.apache.org/confluence/display/WW/S2-001+-+Remote+code+exploit+on+form+validation+error
>
>
> This link doesn't appear to work, at least for me.
It has been renamed to:
http://cwiki.apache.org/confluence/display/WW/S2-001
Antonio
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: Preventing OGNL evaluations of user input (was Re: Struts 2 performance)
Posted by "Ing. Andrea Vettori" <ma...@andreavettori.com>.
What about the change of order of evaluation ? Am I correct ?
Don't think it's important however...
Il giorno 16/lug/07, alle ore 17:03, Don Brown ha scritto:
> I've added a security bulletin to our official Struts 2
> documentation to
> begin to formalize this issue and its solution:
> http://cwiki.apache.org/confluence/display/WW/S2-001+-+Remote+code
> +exploit+on+form+validation+error
>
> Don
>
> On 7/17/07, Don Brown <mr...@twdata.org> wrote:
>>
>> The patch I commited is based on the original loopcount patch, but
>> fixes
>> the problem where it wouldn't evaluate all non-recursive expressions.
>> Therefore, the issue has been fixed and all tests still pass. I
>> agree that
>> we should re-evaluate our usage of ognl down the road, but I
>> believe the
>> committed fix will resolve the security issue. I've back-ported
>> the fix to
>> XWork 2.0 and XWork 1.2, and Rainer has promised XWork releases in
>> the
>> next few days.
>>
>> Don
>>
>> On 7/17/07, Ing. Andrea Vettori < mail@andreavettori.com> wrote:
>> >
>> >
>> > Il giorno 16/lug/07, alle ore 16:46, Antonio Petrelli ha scritto:
>> >
>> > > 2007/7/16, Ing. Andrea Vettori <ma...@andreavettori.com>:
>> > >>
>> > >> I suggested the value can be parametrized so if one
>> > >> known he use complex expression can use a higher value. (b)
>> is solved
>> >
>> > >> using loopCount=1 by default when dealing with user input.
>> > >
>> > >
>> > >
>> > > OK! Thank you I think I got the point.
>> > > So you are saying that, with loopCount=1, the evaluation step
>> stops at
>> >
>> > > evaluating the string as it is, right?
>> >
>> > ok !
>> >
>> > Now we should only understand what to do with expression like "%
>> {foo}
>> > %{bar}" that has more than one expression at the "same"
>> recursion level.
>> >
>> >
>> >
>> > --
>> > Ing. Andrea Vettori
>> > Consulente per l'Information Technology
>> >
>> >
>> >
>> >
>> ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
>> > For additional commands, e-mail: dev-help@struts.apache.org
>> >
>> >
>>
--
Ing. Andrea Vettori
Consulente per l'Information Technology
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: Preventing OGNL evaluations of user input (was Re: Struts 2 performance)
Posted by Martin Cooper <ma...@apache.org>.
On 7/16/07, Don Brown <mr...@twdata.org> wrote:
>
> I've added a security bulletin to our official Struts 2 documentation to
> begin to formalize this issue and its solution:
>
> http://cwiki.apache.org/confluence/display/WW/S2-001+-+Remote+code+exploit+on+form+validation+error
This link doesn't appear to work, at least for me.
--
Martin Cooper
Don
>
> On 7/17/07, Don Brown <mr...@twdata.org> wrote:
> >
> > The patch I commited is based on the original loopcount patch, but fixes
> > the problem where it wouldn't evaluate all non-recursive expressions.
> > Therefore, the issue has been fixed and all tests still pass. I agree
> that
> > we should re-evaluate our usage of ognl down the road, but I believe the
> > committed fix will resolve the security issue. I've back-ported the fix
> to
> > XWork 2.0 and XWork 1.2, and Rainer has promised XWork releases in the
> > next few days.
> >
> > Don
> >
> > On 7/17/07, Ing. Andrea Vettori < mail@andreavettori.com> wrote:
> > >
> > >
> > > Il giorno 16/lug/07, alle ore 16:46, Antonio Petrelli ha scritto:
> > >
> > > > 2007/7/16, Ing. Andrea Vettori <ma...@andreavettori.com>:
> > > >>
> > > >> I suggested the value can be parametrized so if one
> > > >> known he use complex expression can use a higher value. (b) is
> solved
> > >
> > > >> using loopCount=1 by default when dealing with user input.
> > > >
> > > >
> > > >
> > > > OK! Thank you I think I got the point.
> > > > So you are saying that, with loopCount=1, the evaluation step stops
> at
> > >
> > > > evaluating the string as it is, right?
> > >
> > > ok !
> > >
> > > Now we should only understand what to do with expression like "%{foo}
> > > %{bar}" that has more than one expression at the "same" recursion
> level.
> > >
> > >
> > >
> > > --
> > > Ing. Andrea Vettori
> > > Consulente per l'Information Technology
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> > > For additional commands, e-mail: dev-help@struts.apache.org
> > >
> > >
> >
>
Re: Preventing OGNL evaluations of user input (was Re: Struts 2 performance)
Posted by Don Brown <mr...@twdata.org>.
I've added a security bulletin to our official Struts 2 documentation to
begin to formalize this issue and its solution:
http://cwiki.apache.org/confluence/display/WW/S2-001+-+Remote+code+exploit+on+form+validation+error
Don
On 7/17/07, Don Brown <mr...@twdata.org> wrote:
>
> The patch I commited is based on the original loopcount patch, but fixes
> the problem where it wouldn't evaluate all non-recursive expressions.
> Therefore, the issue has been fixed and all tests still pass. I agree that
> we should re-evaluate our usage of ognl down the road, but I believe the
> committed fix will resolve the security issue. I've back-ported the fix to
> XWork 2.0 and XWork 1.2, and Rainer has promised XWork releases in the
> next few days.
>
> Don
>
> On 7/17/07, Ing. Andrea Vettori < mail@andreavettori.com> wrote:
> >
> >
> > Il giorno 16/lug/07, alle ore 16:46, Antonio Petrelli ha scritto:
> >
> > > 2007/7/16, Ing. Andrea Vettori <ma...@andreavettori.com>:
> > >>
> > >> I suggested the value can be parametrized so if one
> > >> known he use complex expression can use a higher value. (b) is solved
> >
> > >> using loopCount=1 by default when dealing with user input.
> > >
> > >
> > >
> > > OK! Thank you I think I got the point.
> > > So you are saying that, with loopCount=1, the evaluation step stops at
> >
> > > evaluating the string as it is, right?
> >
> > ok !
> >
> > Now we should only understand what to do with expression like "%{foo}
> > %{bar}" that has more than one expression at the "same" recursion level.
> >
> >
> >
> > --
> > Ing. Andrea Vettori
> > Consulente per l'Information Technology
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> > For additional commands, e-mail: dev-help@struts.apache.org
> >
> >
>
Re: Preventing OGNL evaluations of user input (was Re: Struts 2 performance)
Posted by Don Brown <mr...@twdata.org>.
The patch I commited is based on the original loopcount patch, but fixes the
problem where it wouldn't evaluate all non-recursive expressions.
Therefore, the issue has been fixed and all tests still pass. I agree that
we should re-evaluate our usage of ognl down the road, but I believe the
committed fix will resolve the security issue. I've back-ported the fix to
XWork 2.0 and XWork 1.2, and Rainer has promised XWork releases in the next
few days.
Don
On 7/17/07, Ing. Andrea Vettori <ma...@andreavettori.com> wrote:
>
>
> Il giorno 16/lug/07, alle ore 16:46, Antonio Petrelli ha scritto:
>
> > 2007/7/16, Ing. Andrea Vettori <ma...@andreavettori.com>:
> >>
> >> I suggested the value can be parametrized so if one
> >> known he use complex expression can use a higher value. (b) is solved
> >> using loopCount=1 by default when dealing with user input.
> >
> >
> >
> > OK! Thank you I think I got the point.
> > So you are saying that, with loopCount=1, the evaluation step stops at
> > evaluating the string as it is, right?
>
> ok !
>
> Now we should only understand what to do with expression like "%{foo}
> %{bar}" that has more than one expression at the "same" recursion level.
>
>
> --
> Ing. Andrea Vettori
> Consulente per l'Information Technology
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>
Re: Preventing OGNL evaluations of user input (was Re: Struts 2 performance)
Posted by "Ing. Andrea Vettori" <ma...@andreavettori.com>.
Il giorno 16/lug/07, alle ore 16:46, Antonio Petrelli ha scritto:
> 2007/7/16, Ing. Andrea Vettori <ma...@andreavettori.com>:
>>
>> I suggested the value can be parametrized so if one
>> known he use complex expression can use a higher value. (b) is solved
>> using loopCount=1 by default when dealing with user input.
>
>
>
> OK! Thank you I think I got the point.
> So you are saying that, with loopCount=1, the evaluation step stops at
> evaluating the string as it is, right?
ok !
Now we should only understand what to do with expression like "%{foo}
%{bar}" that has more than one expression at the "same" recursion level.
--
Ing. Andrea Vettori
Consulente per l'Information Technology
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: Preventing OGNL evaluations of user input (was Re: Struts 2 performance)
Posted by Antonio Petrelli <an...@gmail.com>.
2007/7/16, Ing. Andrea Vettori <ma...@andreavettori.com>:
>
> I suggested the value can be parametrized so if one
> known he use complex expression can use a higher value. (b) is solved
> using loopCount=1 by default when dealing with user input.
OK! Thank you I think I got the point.
So you are saying that, with loopCount=1, the evaluation step stops at
evaluating the string as it is, right?
Now it's all clear, thanks again.
Antonio
Re: Preventing OGNL evaluations of user input (was Re: Struts 2 performance)
Posted by "Ing. Andrea Vettori" <ma...@andreavettori.com>.
The "Musachy" patch that prevents the parameters to have the pattern %
{*} works great as a workaround (and i'm using that in my e-commerce
site where I found this problem).
I think that the final patch should address the unlikely but possible
case when the user has to enter (or we need to pass to an action)
something like %{*} as a parameter. As discussed in the jira ticket I
think that the patch should (a) prevent infinite recursion (as
circular reference as you said) and (b) prevent the user input to be
evaluated as expressions. If loopCount is the recursion counter, (a)
is solved for any limited value but it limits the complexity of the
expressions. I suggested the value can be parametrized so if one
known he use complex expression can use a higher value. (b) is solved
using loopCount=1 by default when dealing with user input.
Il giorno 16/lug/07, alle ore 16:31, Antonio Petrelli ha scritto:
> Probably there was a misunderstanding Andrea.
>
> First of all, are we talking about:
> 1. the "preliminar" patch, that at least prevents remote exploit by
> disallowing malicious code,
> or
> 2. the final patch? In this case, the final patch, is "1." or a
> patch that,
> as I stated before, removes completely OGNL evaluation of user-entered
> values?
>
> I think that the conversation should follow two different
> direction: one for
> the immediate future (to solve the vulnerability) and one for the
> final
> decision.
>
> Antonio
>
> 2007/7/16, Ing. Andrea Vettori <ma...@andreavettori.com>:
>>
>> Antonio,
>>
>> the recursion solve the problem because after the first "step" you
>> are exposing to the remote exploit. The first evaluation step is
>> secure.
>>
>> If you have %{foo} somewhere and you evaluate it if the property foo
>> does not contain an expression you are safe. If it contains an
>> expression you are recursive-evaluating and that's the problem.
>>
>> You can't have a circular-reference (like the one that caused me to
>> find this big problem) if you disable recursion.
>>
>> Moreover I think it is always a good coding practice when using
>> recursion to have a max loop limit to break off the loop if something
>> goes wrong.
>>
>> It's the way the patch is implemented (I noticed my fault after
>> posting the patch) that prevents expression that is not recursive
>> like "%{foo} %{bar}" to be evaluated. I don't think it's a problem
>> but we should know that this type of expressions will not be
>> evaluated after installing the patch.
>>
>> Maybe Don has addressed this kind of expression in his patch... I'll
>> take a look at it later.
>>
>>
>> Il giorno 16/lug/07, alle ore 16:09, Antonio Petrelli ha scritto:
>>
>> > 2007/7/16, Ing. Andrea Vettori <ma...@andreavettori.com>:
>> >>
>> >> What about expression like "%{foo} %{bar}" that work with the
>> current
>> >> version but don't work using the loopCounter patch ?
>> >>
>> >> I don't think we need them but who knows...
>> >
>> >
>> >
>> > I think that recursion is a false problem: it's up to the
>> developer to
>> > control it (I don't think that JSP EL controls it, correct me if
>> I am
>> > wrong). Eventually a log message can be written, but preventing it
>> > is not a
>> > solution, because a particular case (such as circular reference)
>> > will be
>> > always present.
>> > The "real" problem is that a user should not be allowed to execute
>> > such OGNL
>> > code!
>> >
>> > Antonio
>>
>> --
>> Ing. Andrea Vettori
>> Consulente per l'Information Technology
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
>> For additional commands, e-mail: dev-help@struts.apache.org
>>
>>
--
Ing. Andrea Vettori
Consulente per l'Information Technology
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: Preventing OGNL evaluations of user input (was Re: Struts 2 performance)
Posted by Antonio Petrelli <an...@gmail.com>.
Probably there was a misunderstanding Andrea.
First of all, are we talking about:
1. the "preliminar" patch, that at least prevents remote exploit by
disallowing malicious code,
or
2. the final patch? In this case, the final patch, is "1." or a patch that,
as I stated before, removes completely OGNL evaluation of user-entered
values?
I think that the conversation should follow two different direction: one for
the immediate future (to solve the vulnerability) and one for the final
decision.
Antonio
2007/7/16, Ing. Andrea Vettori <ma...@andreavettori.com>:
>
> Antonio,
>
> the recursion solve the problem because after the first "step" you
> are exposing to the remote exploit. The first evaluation step is secure.
>
> If you have %{foo} somewhere and you evaluate it if the property foo
> does not contain an expression you are safe. If it contains an
> expression you are recursive-evaluating and that's the problem.
>
> You can't have a circular-reference (like the one that caused me to
> find this big problem) if you disable recursion.
>
> Moreover I think it is always a good coding practice when using
> recursion to have a max loop limit to break off the loop if something
> goes wrong.
>
> It's the way the patch is implemented (I noticed my fault after
> posting the patch) that prevents expression that is not recursive
> like "%{foo} %{bar}" to be evaluated. I don't think it's a problem
> but we should know that this type of expressions will not be
> evaluated after installing the patch.
>
> Maybe Don has addressed this kind of expression in his patch... I'll
> take a look at it later.
>
>
> Il giorno 16/lug/07, alle ore 16:09, Antonio Petrelli ha scritto:
>
> > 2007/7/16, Ing. Andrea Vettori <ma...@andreavettori.com>:
> >>
> >> What about expression like "%{foo} %{bar}" that work with the current
> >> version but don't work using the loopCounter patch ?
> >>
> >> I don't think we need them but who knows...
> >
> >
> >
> > I think that recursion is a false problem: it's up to the developer to
> > control it (I don't think that JSP EL controls it, correct me if I am
> > wrong). Eventually a log message can be written, but preventing it
> > is not a
> > solution, because a particular case (such as circular reference)
> > will be
> > always present.
> > The "real" problem is that a user should not be allowed to execute
> > such OGNL
> > code!
> >
> > Antonio
>
> --
> Ing. Andrea Vettori
> Consulente per l'Information Technology
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>
Re: Preventing OGNL evaluations of user input (was Re: Struts 2 performance)
Posted by "Ing. Andrea Vettori" <ma...@andreavettori.com>.
Antonio,
the recursion solve the problem because after the first "step" you
are exposing to the remote exploit. The first evaluation step is secure.
If you have %{foo} somewhere and you evaluate it if the property foo
does not contain an expression you are safe. If it contains an
expression you are recursive-evaluating and that's the problem.
You can't have a circular-reference (like the one that caused me to
find this big problem) if you disable recursion.
Moreover I think it is always a good coding practice when using
recursion to have a max loop limit to break off the loop if something
goes wrong.
It's the way the patch is implemented (I noticed my fault after
posting the patch) that prevents expression that is not recursive
like "%{foo} %{bar}" to be evaluated. I don't think it's a problem
but we should know that this type of expressions will not be
evaluated after installing the patch.
Maybe Don has addressed this kind of expression in his patch... I'll
take a look at it later.
Il giorno 16/lug/07, alle ore 16:09, Antonio Petrelli ha scritto:
> 2007/7/16, Ing. Andrea Vettori <ma...@andreavettori.com>:
>>
>> What about expression like "%{foo} %{bar}" that work with the current
>> version but don't work using the loopCounter patch ?
>>
>> I don't think we need them but who knows...
>
>
>
> I think that recursion is a false problem: it's up to the developer to
> control it (I don't think that JSP EL controls it, correct me if I am
> wrong). Eventually a log message can be written, but preventing it
> is not a
> solution, because a particular case (such as circular reference)
> will be
> always present.
> The "real" problem is that a user should not be allowed to execute
> such OGNL
> code!
>
> Antonio
--
Ing. Andrea Vettori
Consulente per l'Information Technology
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: Preventing OGNL evaluations of user input (was Re: Struts 2 performance)
Posted by Alexandru Popescu ☀ <th...@gmail.com>.
On 7/16/07, Antonio Petrelli <an...@gmail.com> wrote:
> 2007/7/16, Ian Roughley <ia...@fdar.com>:
> >
> > What do you define as "a user should not be allowed to execute such OGNL
> > code!"? There are times that I want to call a static method and use the
> > results. The problem to me (and as Don pointed out), is that there is
> > malicious code stored in the database that was entered by users - and is
> > a type of XSS attack.
>
>
>
> Sorry, maybe I used the wrong terms.
> Data entered by users (i.e. people that uses the application) must not be
> evaluated.
> A developer (i.e. a person that maintains the application) can do almost
> anything.
>
I 100% agree on this. I don't see any good reasons for evaluating the
strings entered from the client side of the app.
./alex
--
.w( the_mindstorm )p.
>
> The other option is that a hacker as access to your web app file system
> > and is changing a template. If this is the case, my personal feeling is
> > that you should be glad they are only changing templates and not doing a
> > number of other things :-)
>
>
>
> This is exactly what the security bulletin addresses. And, personally, I
> hope that those who are using Struts 2/WebWork in their applications do not
> receive much harm...
>
> Antonio
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: Preventing OGNL evaluations of user input (was Re: Struts 2 performance)
Posted by Antonio Petrelli <an...@gmail.com>.
2007/7/16, Ian Roughley <ia...@fdar.com>:
>
> What do you define as "a user should not be allowed to execute such OGNL
> code!"? There are times that I want to call a static method and use the
> results. The problem to me (and as Don pointed out), is that there is
> malicious code stored in the database that was entered by users - and is
> a type of XSS attack.
Sorry, maybe I used the wrong terms.
Data entered by users (i.e. people that uses the application) must not be
evaluated.
A developer (i.e. a person that maintains the application) can do almost
anything.
The other option is that a hacker as access to your web app file system
> and is changing a template. If this is the case, my personal feeling is
> that you should be glad they are only changing templates and not doing a
> number of other things :-)
This is exactly what the security bulletin addresses. And, personally, I
hope that those who are using Struts 2/WebWork in their applications do not
receive much harm...
Antonio
Re: Preventing OGNL evaluations of user input (was Re: Struts 2 performance)
Posted by Ian Roughley <ia...@fdar.com>.
What do you define as "a user should not be allowed to execute such OGNL
code!"? There are times that I want to call a static method and use the
results. The problem to me (and as Don pointed out), is that there is
malicious code stored in the database that was entered by users - and is
a type of XSS attack.
The other option is that a hacker as access to your web app file system
and is changing a template. If this is the case, my personal feeling is
that you should be glad they are only changing templates and not doing a
number of other things :-)
/Ian
Antonio Petrelli wrote:
> 2007/7/16, Ing. Andrea Vettori <ma...@andreavettori.com>:
>>
>> What about expression like "%{foo} %{bar}" that work with the current
>> version but don't work using the loopCounter patch ?
>>
>> I don't think we need them but who knows...
>
>
>
> I think that recursion is a false problem: it's up to the developer to
> control it (I don't think that JSP EL controls it, correct me if I am
> wrong). Eventually a log message can be written, but preventing it is
> not a
> solution, because a particular case (such as circular reference) will be
> always present.
> The "real" problem is that a user should not be allowed to execute
> such OGNL
> code!
>
> Antonio
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: Preventing OGNL evaluations of user input (was Re: Struts 2 performance)
Posted by Antonio Petrelli <an...@gmail.com>.
2007/7/16, Ing. Andrea Vettori <ma...@andreavettori.com>:
>
> What about expression like "%{foo} %{bar}" that work with the current
> version but don't work using the loopCounter patch ?
>
> I don't think we need them but who knows...
I think that recursion is a false problem: it's up to the developer to
control it (I don't think that JSP EL controls it, correct me if I am
wrong). Eventually a log message can be written, but preventing it is not a
solution, because a particular case (such as circular reference) will be
always present.
The "real" problem is that a user should not be allowed to execute such OGNL
code!
Antonio
Re: Preventing OGNL evaluations of user input (was Re: Struts 2 performance)
Posted by "Ing. Andrea Vettori" <ma...@andreavettori.com>.
What about expression like "%{foo} %{bar}" that work with the current
version but don't work using the loopCounter patch ?
I don't think we need them but who knows...
Il giorno 16/lug/07, alle ore 15:38, Don Brown ha scritto:
> From my tests, recursion is never really used and is just a
> byproduct of how
> the text parsing algorithm works. I improved the algorithm to be
> able to
> detect and selectively enable recursion, although it is off by
> default.
> Having done that, all XWork and Struts 2 tests still passed, so I'm
> fairly
> confident most, if not all, WW/S2 applications should be ok.
>
> Don
>
> On 7/16/07, Musachy Barroso <mu...@gmail.com> wrote:
>>
>> I wouldn't agree that's a good solution, as it will be more
>> difficult for
>> users to understand, they will have to remember the enable/disable
>> the
>> recursion with serious problems if they don't, and questions will
>> be asked
>> by the thousands on the mailing list :). On top of that it will break
>> backward compatibility big time.
>>
>> The only drawback of preventing the evaluation of parameters is
>> that if
>> someone is trying to pass a parameter in the form %{...}, it won't
>> work,
>> which most likely nobody is doing, and if they have to, they could
>> escape
>> it
>> to %\{...\} or something else.
>>
>> musachy
>>
>> On 7/16/07, Don Brown <mr...@twdata.org> wrote:
>> >
>> > I think the real solution is in fixing the recursive processing
>> of text.
>> > I'm working on a patch that will ensure the 'value' attribute isn't
>> > processed recursively, thereby, resolving our issue. The
>> question then
>> is
>> > to turn recursive processing on by default or not. If not and
>> we make a
>> > special case for the 'value' attribute, it could still be
>> possible for
>> the
>> > user to shoot themselves in the foot by creating a localisation
>> message
>> > such
>> > as:
>> >
>> > The name needs at least %{minSize} characters
>> >
>> > Then, the attacker just needs to submit a form with a field like:
>> >
>> > <input type="hidden" name="minSize" value="%
>> {@java.lang.System@exit(0)}"
>> > />
>> >
>> > This happens because the form parameters are on the top of the
>> stack
>> > usually.
>> >
>> > Therefore, the safest solution is to turn recursive processing
>> off by
>> > default and selectively allow a user to allow recursion through
>> an extra
>> > tag
>> > attribute or similar means. However, that will definitely break
>> existing
>> > apps, where only turning recursion off for the 'value' attribute
>> has a
>> > much
>> > smaller chance of breaking apps.
>> >
>> > Don
>> >
>> > On 7/16/07, Martin Gilday <ma...@imap.cc> wrote:
>> > >
>> > > As has been said the current fix is not ideal. The changes
>> that have
>> > > been made to params interceptor mean that the functionality in
>> > > ParamsInterceptor and ParamFilterInterceptor are now very
>> similar,
>> > > except one supports regex. Would it be worthwile trying to
>> combine
>> > > these now that it is apparent they are crucial to security?
>> With this
>> > > fix there is the danger now that as soon as anyone adds in
>> there own
>> > > "excludePattern" they can remove the default which is
>> preventing the
>> > > ognl hack, without realising the problem they are creating.
>> > >
>> > >
>> > > ----- Original message -----
>> > > From: "Don Brown" <do...@gmail.com>
>> > > To: "Struts Developers List" <de...@struts.apache.org>
>> > > Date: Mon, 16 Jul 2007 21:49:15 +1000
>> > > Subject: Re: Preventing OGNL evaluations of user input (was
>> Re: Struts
>> 2
>> > > performance)
>> > >
>> > > Continuing in dev@ ...
>> > >
>> > > On 7/16/07, Aram Mkhitaryan <ar...@googlemail.com>
>> wrote:
>> > > > Don, could you please send the subject to continue the
>> discussion
>> in?
>> > > > Should we use dev@struts.apache.org?
>> > > >
>> > > > Thanks,
>> > > > Aram
>> > > > ________________________________
>> > > > Aram Mkhitaryan
>> > > >
>> > > > 52, 25 Lvovyan, Yerevan 375000, Armenia
>> > > >
>> > > > Mobile: +374 91 518456
>> > > > E-mail: aram.mkhitaryan@googlemail.com
>> > > >
>> > >
>> > >
>> ---------------------------------------------------------------------
>> > > To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
>> > > For additional commands, e-mail: dev-help@struts.apache.org
>> > >
>> > >
>> > >
>> ---------------------------------------------------------------------
>> > > To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
>> > > For additional commands, e-mail: dev-help@struts.apache.org
>> > >
>> > >
>> >
>>
>>
>>
>> --
>> "Hey you! Would you help me to carry the stone?" Pink Floyd
>>
--
Ing. Andrea Vettori
Consulente per l'Information Technology
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: Preventing OGNL evaluations of user input (was Re: Struts 2 performance)
Posted by Don Brown <mr...@twdata.org>.
>From my tests, recursion is never really used and is just a byproduct of how
the text parsing algorithm works. I improved the algorithm to be able to
detect and selectively enable recursion, although it is off by default.
Having done that, all XWork and Struts 2 tests still passed, so I'm fairly
confident most, if not all, WW/S2 applications should be ok.
Don
On 7/16/07, Musachy Barroso <mu...@gmail.com> wrote:
>
> I wouldn't agree that's a good solution, as it will be more difficult for
> users to understand, they will have to remember the enable/disable the
> recursion with serious problems if they don't, and questions will be asked
> by the thousands on the mailing list :). On top of that it will break
> backward compatibility big time.
>
> The only drawback of preventing the evaluation of parameters is that if
> someone is trying to pass a parameter in the form %{...}, it won't work,
> which most likely nobody is doing, and if they have to, they could escape
> it
> to %\{...\} or something else.
>
> musachy
>
> On 7/16/07, Don Brown <mr...@twdata.org> wrote:
> >
> > I think the real solution is in fixing the recursive processing of text.
> > I'm working on a patch that will ensure the 'value' attribute isn't
> > processed recursively, thereby, resolving our issue. The question then
> is
> > to turn recursive processing on by default or not. If not and we make a
> > special case for the 'value' attribute, it could still be possible for
> the
> > user to shoot themselves in the foot by creating a localisation message
> > such
> > as:
> >
> > The name needs at least %{minSize} characters
> >
> > Then, the attacker just needs to submit a form with a field like:
> >
> > <input type="hidden" name="minSize" value="%{@java.lang.System@exit(0)}"
> > />
> >
> > This happens because the form parameters are on the top of the stack
> > usually.
> >
> > Therefore, the safest solution is to turn recursive processing off by
> > default and selectively allow a user to allow recursion through an extra
> > tag
> > attribute or similar means. However, that will definitely break
> existing
> > apps, where only turning recursion off for the 'value' attribute has a
> > much
> > smaller chance of breaking apps.
> >
> > Don
> >
> > On 7/16/07, Martin Gilday <ma...@imap.cc> wrote:
> > >
> > > As has been said the current fix is not ideal. The changes that have
> > > been made to params interceptor mean that the functionality in
> > > ParamsInterceptor and ParamFilterInterceptor are now very similar,
> > > except one supports regex. Would it be worthwile trying to combine
> > > these now that it is apparent they are crucial to security? With this
> > > fix there is the danger now that as soon as anyone adds in there own
> > > "excludePattern" they can remove the default which is preventing the
> > > ognl hack, without realising the problem they are creating.
> > >
> > >
> > > ----- Original message -----
> > > From: "Don Brown" <do...@gmail.com>
> > > To: "Struts Developers List" <de...@struts.apache.org>
> > > Date: Mon, 16 Jul 2007 21:49:15 +1000
> > > Subject: Re: Preventing OGNL evaluations of user input (was Re: Struts
> 2
> > > performance)
> > >
> > > Continuing in dev@ ...
> > >
> > > On 7/16/07, Aram Mkhitaryan <ar...@googlemail.com> wrote:
> > > > Don, could you please send the subject to continue the discussion
> in?
> > > > Should we use dev@struts.apache.org?
> > > >
> > > > Thanks,
> > > > Aram
> > > > ________________________________
> > > > Aram Mkhitaryan
> > > >
> > > > 52, 25 Lvovyan, Yerevan 375000, Armenia
> > > >
> > > > Mobile: +374 91 518456
> > > > E-mail: aram.mkhitaryan@googlemail.com
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> > > For additional commands, e-mail: dev-help@struts.apache.org
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> > > For additional commands, e-mail: dev-help@struts.apache.org
> > >
> > >
> >
>
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>
Re: Preventing OGNL evaluations of user input (was Re: Struts 2 performance)
Posted by Musachy Barroso <mu...@gmail.com>.
I wouldn't agree that's a good solution, as it will be more difficult for
users to understand, they will have to remember the enable/disable the
recursion with serious problems if they don't, and questions will be asked
by the thousands on the mailing list :). On top of that it will break
backward compatibility big time.
The only drawback of preventing the evaluation of parameters is that if
someone is trying to pass a parameter in the form %{...}, it won't work,
which most likely nobody is doing, and if they have to, they could escape it
to %\{...\} or something else.
musachy
On 7/16/07, Don Brown <mr...@twdata.org> wrote:
>
> I think the real solution is in fixing the recursive processing of text.
> I'm working on a patch that will ensure the 'value' attribute isn't
> processed recursively, thereby, resolving our issue. The question then is
> to turn recursive processing on by default or not. If not and we make a
> special case for the 'value' attribute, it could still be possible for the
> user to shoot themselves in the foot by creating a localisation message
> such
> as:
>
> The name needs at least %{minSize} characters
>
> Then, the attacker just needs to submit a form with a field like:
>
> <input type="hidden" name="minSize" value="%{@java.lang.System@exit(0)}"
> />
>
> This happens because the form parameters are on the top of the stack
> usually.
>
> Therefore, the safest solution is to turn recursive processing off by
> default and selectively allow a user to allow recursion through an extra
> tag
> attribute or similar means. However, that will definitely break existing
> apps, where only turning recursion off for the 'value' attribute has a
> much
> smaller chance of breaking apps.
>
> Don
>
> On 7/16/07, Martin Gilday <ma...@imap.cc> wrote:
> >
> > As has been said the current fix is not ideal. The changes that have
> > been made to params interceptor mean that the functionality in
> > ParamsInterceptor and ParamFilterInterceptor are now very similar,
> > except one supports regex. Would it be worthwile trying to combine
> > these now that it is apparent they are crucial to security? With this
> > fix there is the danger now that as soon as anyone adds in there own
> > "excludePattern" they can remove the default which is preventing the
> > ognl hack, without realising the problem they are creating.
> >
> >
> > ----- Original message -----
> > From: "Don Brown" <do...@gmail.com>
> > To: "Struts Developers List" <de...@struts.apache.org>
> > Date: Mon, 16 Jul 2007 21:49:15 +1000
> > Subject: Re: Preventing OGNL evaluations of user input (was Re: Struts 2
> > performance)
> >
> > Continuing in dev@ ...
> >
> > On 7/16/07, Aram Mkhitaryan <ar...@googlemail.com> wrote:
> > > Don, could you please send the subject to continue the discussion in?
> > > Should we use dev@struts.apache.org?
> > >
> > > Thanks,
> > > Aram
> > > ________________________________
> > > Aram Mkhitaryan
> > >
> > > 52, 25 Lvovyan, Yerevan 375000, Armenia
> > >
> > > Mobile: +374 91 518456
> > > E-mail: aram.mkhitaryan@googlemail.com
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> > For additional commands, e-mail: dev-help@struts.apache.org
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> > For additional commands, e-mail: dev-help@struts.apache.org
> >
> >
>
--
"Hey you! Would you help me to carry the stone?" Pink Floyd
Re: Preventing OGNL evaluations of user input (was Re: Struts 2 performance)
Posted by Don Brown <mr...@twdata.org>.
I think the real solution is in fixing the recursive processing of text.
I'm working on a patch that will ensure the 'value' attribute isn't
processed recursively, thereby, resolving our issue. The question then is
to turn recursive processing on by default or not. If not and we make a
special case for the 'value' attribute, it could still be possible for the
user to shoot themselves in the foot by creating a localisation message such
as:
The name needs at least %{minSize} characters
Then, the attacker just needs to submit a form with a field like:
<input type="hidden" name="minSize" value="%{@java.lang.System@exit(0)}" />
This happens because the form parameters are on the top of the stack
usually.
Therefore, the safest solution is to turn recursive processing off by
default and selectively allow a user to allow recursion through an extra tag
attribute or similar means. However, that will definitely break existing
apps, where only turning recursion off for the 'value' attribute has a much
smaller chance of breaking apps.
Don
On 7/16/07, Martin Gilday <ma...@imap.cc> wrote:
>
> As has been said the current fix is not ideal. The changes that have
> been made to params interceptor mean that the functionality in
> ParamsInterceptor and ParamFilterInterceptor are now very similar,
> except one supports regex. Would it be worthwile trying to combine
> these now that it is apparent they are crucial to security? With this
> fix there is the danger now that as soon as anyone adds in there own
> "excludePattern" they can remove the default which is preventing the
> ognl hack, without realising the problem they are creating.
>
>
> ----- Original message -----
> From: "Don Brown" <do...@gmail.com>
> To: "Struts Developers List" <de...@struts.apache.org>
> Date: Mon, 16 Jul 2007 21:49:15 +1000
> Subject: Re: Preventing OGNL evaluations of user input (was Re: Struts 2
> performance)
>
> Continuing in dev@ ...
>
> On 7/16/07, Aram Mkhitaryan <ar...@googlemail.com> wrote:
> > Don, could you please send the subject to continue the discussion in?
> > Should we use dev@struts.apache.org?
> >
> > Thanks,
> > Aram
> > ________________________________
> > Aram Mkhitaryan
> >
> > 52, 25 Lvovyan, Yerevan 375000, Armenia
> >
> > Mobile: +374 91 518456
> > E-mail: aram.mkhitaryan@googlemail.com
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>
Re: Preventing OGNL evaluations of user input (was Re: Struts 2
performance)
Posted by Martin Gilday <ma...@imap.cc>.
As has been said the current fix is not ideal. The changes that have
been made to params interceptor mean that the functionality in
ParamsInterceptor and ParamFilterInterceptor are now very similar,
except one supports regex. Would it be worthwile trying to combine
these now that it is apparent they are crucial to security? With this
fix there is the danger now that as soon as anyone adds in there own
"excludePattern" they can remove the default which is preventing the
ognl hack, without realising the problem they are creating.
----- Original message -----
From: "Don Brown" <do...@gmail.com>
To: "Struts Developers List" <de...@struts.apache.org>
Date: Mon, 16 Jul 2007 21:49:15 +1000
Subject: Re: Preventing OGNL evaluations of user input (was Re: Struts 2
performance)
Continuing in dev@ ...
On 7/16/07, Aram Mkhitaryan <ar...@googlemail.com> wrote:
> Don, could you please send the subject to continue the discussion in?
> Should we use dev@struts.apache.org?
>
> Thanks,
> Aram
> ________________________________
> Aram Mkhitaryan
>
> 52, 25 Lvovyan, Yerevan 375000, Armenia
>
> Mobile: +374 91 518456
> E-mail: aram.mkhitaryan@googlemail.com
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: Preventing OGNL evaluations of user input (was Re: Struts 2 performance)
Posted by Don Brown <do...@gmail.com>.
Continuing in dev@ ...
On 7/16/07, Aram Mkhitaryan <ar...@googlemail.com> wrote:
> Don, could you please send the subject to continue the discussion in?
> Should we use dev@struts.apache.org?
>
> Thanks,
> Aram
> ________________________________
> Aram Mkhitaryan
>
> 52, 25 Lvovyan, Yerevan 375000, Armenia
>
> Mobile: +374 91 518456
> E-mail: aram.mkhitaryan@googlemail.com
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Struts + RIA
Posted by "Corro Fuentes, Gerardo" <gc...@scpec.net>.
Hi,
I need to create a really fancy GUI, so I've been thinking about
integrating struts with a Rich Internet Application framework (RIA)
Is there a recomendation about which RIA is a good option to be used in
conjuction with Struts?
Or
Is there a good view layer technology that is recomended to be used with
struts?
Thanks a lot!
///GChitaryan@googlemail.com
Este mensaje de correo electronico y sus documentos adjuntos estan dirigidos EXCLUSIVAMENTE a los destinatarios especificados. La informacion contenida puede ser CONFIDENCIAL y/o estar LEGALMENTE PROTEGIDA y no necesariamente refleja la opinion de ENDESA. Si usted recibe este mensaje por ERROR, por favor comuniqueselo inmediatamente al remitente y ELIMINELO ya que usted NO ESTA AUTORIZADO al uso, revelacion, distribucion, impresion o copia de toda o alguna parte de la informacion contenida. Gracias.
This e-mail message and any attached files are intended SOLELY for the addressee/s identified herein. It may contain CONFIDENTIAL and/or LEGALLY PRIVILEGED information and may not necessarily represent the opinion of ENDESA. If you receive this message in ERROR, please immediately notify the sender and DELETE it since you ARE NOT AUTHORIZED to use, disclose, distribute, print or copy all or part of the contained information. Thank you
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Preventing OGNL evaluations of user input (was Re: Struts 2 performance)
Posted by Aram Mkhitaryan <ar...@googlemail.com>.
Don, could you please send the subject to continue the discussion in?
Should we use dev@struts.apache.org?
Thanks,
Aram
________________________________
Aram Mkhitaryan
52, 25 Lvovyan, Yerevan 375000, Armenia
Mobile: +374 91 518456
E-mail: aram.mkhitaryan@googlemail.com
Re: Preventing OGNL evaluations of user input (was Re: Struts 2 performance)
Posted by Don Brown <do...@gmail.com>.
I'm glad to see so many people joining the discussion, but let's
please take this to the dev list. There are a lot of Struts
committers and contributors that don't read this user list. So
please, no more messages on this thread for this list.
Don
On 7/16/07, Don Brown <do...@gmail.com> wrote:
> If your application is displaying user input without checking for
> malicious code, you have a problem whether Struts 2 evaluations ognl
> expressions or not. This is how the majority of Cross-Site
> Scripting (XSS) [1] attacks work, tricking the user into visiting a
> page that the attacker has placed JavaScript that steals their
> cookies.
>
> That said, the average Struts developer may not be aware of how OGNL
> is being used here, so we should do something to better protect the
> application.
>
> I'm taking this discussion over to the dev@ list.
>
> Don
>
> [1] http://en.wikipedia.org/wiki/Cross-site_scripting
>
> On 7/16/07, Aram Mkhitaryan <ar...@googlemail.com> wrote:
> > Maybe it's new just for me, but I found out one of the main reasons of the
> > problem
> >
> > try to submit "%{@java.lang.System@exit(0)}" in the viewable property
> > for example you submit a text, and it is displayed by s2's tags
> >
> > try and have fun ...
> >
> > this expression works and my server shuts down!
> >
> > the problem I mentioned is that when I say "print property" it executes it
> > at first ...
> > but it should not! I'm right, amn't I?
> >
> > why it executes the string value in my property?
> > (it's not just a problem, it's a security risk, the users can hack s2 sites)
> > (at least who may read this message will know that he can hack s2 sites and
> > the simplest way is given above)
> >
> > that's why even when you do not use ognl expressions, it still works and it
> > costs ...
> >
> > Best,
> > Aram
> > ________________________________
> > Aram Mkhitaryan
> >
> > 52, 25 Lvovyan, Yerevan 375000, Armenia
> >
> > Mobile: +374 91 518456
> > E-mail: aram.mkhitaryan@googlemail.com
> >
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Preventing OGNL evaluations of user input (was Re: Struts 2
performance)
Posted by Da...@Newfield.org.
<16...@mail.gmail.com>
<aa...@mail.gmail.com>
<93...@mail.gmail.com>
From: Dale Newfield <Da...@Newfield.org>
Date: Tue, 17 Jul 2007 1:17:55 -0500
Content-type: text/plain; charset=US-ASCII
Content-transfer-encoding: 7bit
"Aram Mkhitaryan" <aram.mkhitaryan@googlemail.com
>I have to repeat my suggestion about the new "eval" method in ognl
>expressions which will force the evaluation
But of course this would still be a security hole if usable by
client-provided strings, and would still need to be disallowed there. How
is surrounding a string with "%{" and "}" not the "eval" you request?
-Dale Newfield
Dale@Newfield.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org