You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Lukasz Lenart <lu...@apache.org> on 2024/07/13 05:04:08 UTC
Showcase app broken by struts.allowlist.classes
Hi,
I'm playing a bit with our Showcase App and noticed a few issues
related to the latest security changes. Here is an example method
annotated as follow:
@Action(value = "bean-validation", results = {
@Result(name = "success", location = "bean-validation.jsp")
})
@SkipValidation
public String beanValidation() {
return SUCCESS;
}
I assumed this should be automatically detected by AllowList mechanism
to add such class to allowed classes list, yet it didn't happen:
[WARN ] ognl.SecurityMemberAccess (SecurityMemberAccess.java:245) -
Declaring class [class
org.apache.struts2.showcase.validation.BeanValidationExampleAction] of
member type [public java.lang.String
org.apache.struts2.showcase.validation.BeanValidationExampleAction.beanValidation()]
is not allowlisted! Add to 'struts.allowlist.classes' or
'struts.allowlist.packageNames' configuration.
This can be a blocker for users to migrate to the latest version.
Cheers
Łukasz
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: Showcase app broken by struts.allowlist.classes
Posted by Kusal Kithul-Godage <ku...@gmail.com>.
Ah just saw this - I've already created a fix PR, took me a little
longer than expected as it turns out there were a few more broken
Showcase Actions which I've also fixed
https://github.com/apache/struts/pull/986
On Sat, Jul 13, 2024 at 7:23 PM Lukasz Lenart <lu...@apache.org> wrote:
>
> sob., 13 lip 2024 o 10:23 Kusal Kithul-Godage
> <ku...@gmail.com> napisał(a):
> > That's correct, it's only enabled by default from 7.0, but I enabled
> > it manually for the Showcase App so we can ensure its functionality
> > and catch regressions. It seems in this case, we have an Action that
> > utilises the Convention plugin but isn't actually covered by any
> > tests.
>
> I can add a test to cover this action plus I will add @StrutsParameter
> where needed
>
> Cheers
> Lukasz
>
> ---------------------------------------------------------------------
> 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: Showcase app broken by struts.allowlist.classes
Posted by Lukasz Lenart <lu...@apache.org>.
sob., 13 lip 2024 o 10:23 Kusal Kithul-Godage
<ku...@gmail.com> napisał(a):
> That's correct, it's only enabled by default from 7.0, but I enabled
> it manually for the Showcase App so we can ensure its functionality
> and catch regressions. It seems in this case, we have an Action that
> utilises the Convention plugin but isn't actually covered by any
> tests.
I can add a test to cover this action plus I will add @StrutsParameter
where needed
Cheers
Lukasz
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: Showcase app broken by struts.allowlist.classes
Posted by Kusal Kithul-Godage <ku...@gmail.com>.
That's correct, it's only enabled by default from 7.0, but I enabled
it manually for the Showcase App so we can ensure its functionality
and catch regressions. It seems in this case, we have an Action that
utilises the Convention plugin but isn't actually covered by any
tests.
On Sat, Jul 13, 2024 at 6:17 PM Lukasz Lenart <lu...@apache.org> wrote:
>
> sob., 13 lip 2024 o 08:05 Kusal Kithul-Godage
> <ku...@gmail.com> napisał(a):>
> > Let me take a look, I think I overlooked testing the OGNL allowlist
> > with the Convention plugin - created WW-5440 to track.
>
> BTW. I thought the stronger security settings have been enabled since
> Struts 7, did I miss something?
>
>
> Regards
> Lukasz
>
> ---------------------------------------------------------------------
> 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: Showcase app broken by struts.allowlist.classes
Posted by Lukasz Lenart <lu...@apache.org>.
sob., 13 lip 2024 o 08:05 Kusal Kithul-Godage
<ku...@gmail.com> napisał(a):>
> Let me take a look, I think I overlooked testing the OGNL allowlist
> with the Convention plugin - created WW-5440 to track.
BTW. I thought the stronger security settings have been enabled since
Struts 7, did I miss something?
Regards
Lukasz
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: Showcase app broken by struts.allowlist.classes
Posted by Kusal Kithul-Godage <ku...@gmail.com>.
Let me take a look, I think I overlooked testing the OGNL allowlist
with the Convention plugin - created WW-5440 to track.
On Sat, Jul 13, 2024 at 3:04 PM Lukasz Lenart <lu...@apache.org> wrote:
>
> Hi,
>
> I'm playing a bit with our Showcase App and noticed a few issues
> related to the latest security changes. Here is an example method
> annotated as follow:
>
> @Action(value = "bean-validation", results = {
> @Result(name = "success", location = "bean-validation.jsp")
> })
> @SkipValidation
> public String beanValidation() {
> return SUCCESS;
> }
>
> I assumed this should be automatically detected by AllowList mechanism
> to add such class to allowed classes list, yet it didn't happen:
>
> [WARN ] ognl.SecurityMemberAccess (SecurityMemberAccess.java:245) -
> Declaring class [class
> org.apache.struts2.showcase.validation.BeanValidationExampleAction] of
> member type [public java.lang.String
> org.apache.struts2.showcase.validation.BeanValidationExampleAction.beanValidation()]
> is not allowlisted! Add to 'struts.allowlist.classes' or
> 'struts.allowlist.packageNames' configuration.
>
> This can be a blocker for users to migrate to the latest version.
>
>
> Cheers
> Łukasz
>
> ---------------------------------------------------------------------
> 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