You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Joseph Walton <jw...@atlassian.com> on 2014/12/02 10:00:40 UTC
isClassExcluded and static methods in 2.3.20
I have OGNL expressions where I’m invoking static methods, and I’m specifically setting 'struts.ognl.allowStaticMethodAccess’ to allow that.
Now, in 2.3.20, these invocations are checked by SecurityMemberAccess.isClassExcluded with Class.class as the first argument. Since this appears on the default struts.excludedClasses, these invocations are blocked.
The obvious workaround is to partially revert struts.excludedClasses, but I would have expected the implementation class to be the one checked. Is this intentional, or an unintended consequence?
Re: isClassExcluded and static methods in 2.3.20
Posted by Lukasz Lenart <lu...@apache.org>.
2014-12-03 3:14 GMT+01:00 Joseph Walton <jw...@atlassian.com>:
> The workaround (copying struts.excludedClasses across from the defaults and
> removing java.lang.Class) works for me for now. I'll consider this another
> warning about static methods going away rather than looking at a fix or
> opening a WW.
>
> This might be worth a note in the release notes, for anyone else still
> using struts.ognl.allowStaticMethodAccess.
I've extended Security page (which is referenced on the Version notes)
https://cwiki.apache.org/confluence/display/WW/Security#Security-Accessingstaticmethods
Regards
--
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: isClassExcluded and static methods in 2.3.20
Posted by Joseph Walton <jw...@atlassian.com>.
On 2 December 2014 at 20:24, Lukasz Lenart <lu...@apache.org> wrote:
> 2014-12-02 10:00 GMT+01:00 Joseph Walton <jw...@atlassian.com>:
> > I have OGNL expressions where I’m invoking static methods, and I’m
> specifically setting 'struts.ognl.allowStaticMethodAccess’ to allow that.
> >
> > Now, in 2.3.20, these invocations are checked by
> SecurityMemberAccess.isClassExcluded with Class.class as the first
> argument. Since this appears on the default struts.excludedClasses, these
> invocations are blocked.
> ...
>
> It's rather an unintended behaviour but support for static methods
> will be removed anyway - this is source of many security problems :(
>
> https://issues.apache.org/jira/browse/WW-4348
>
The workaround (copying struts.excludedClasses across from the defaults and
removing java.lang.Class) works for me for now. I'll consider this another
warning about static methods going away rather than looking at a fix or
opening a WW.
This might be worth a note in the release notes, for anyone else still
using struts.ognl.allowStaticMethodAccess.
Re: isClassExcluded and static methods in 2.3.20
Posted by Lukasz Lenart <lu...@apache.org>.
2014-12-02 10:00 GMT+01:00 Joseph Walton <jw...@atlassian.com>:
> I have OGNL expressions where I’m invoking static methods, and I’m specifically setting 'struts.ognl.allowStaticMethodAccess’ to allow that.
>
> Now, in 2.3.20, these invocations are checked by SecurityMemberAccess.isClassExcluded with Class.class as the first argument. Since this appears on the default struts.excludedClasses, these invocations are blocked.
>
> The obvious workaround is to partially revert struts.excludedClasses, but I would have expected the implementation class to be the one checked. Is this intentional, or an unintended consequence?
It's rather an unintended behaviour but support for static methods
will be removed anyway - this is source of many security problems :(
https://issues.apache.org/jira/browse/WW-4348
Regards
--
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org