Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WW-5339 Document new OGNL security options #215

Merged
merged 1 commit into from
Dec 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions source/security/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,6 @@ There are 4 options that can be used to configure excluded packages and classes:

The defaults are defined [here](https://github.com/apache/struts/blob/master/core/src/main/resources/struts-excluded-classes.xml).

Additionally, static methods are blocked, and static fields can also be blocked with 'struts.allowStaticFieldAccess'.

Any expression or target which does not pass this criteria will be blocked, and you will see a warning in the logs:

```
Expand All @@ -329,6 +327,15 @@ of such expression is `java.lang.Class` which is excluded.
It is possible to redefine the above constants in `struts.xml`, but avoid reducing the list, instead extending the list
with other known dangerous classes or packages in your application.

#### Additional Options

We additionally recommend enabling the following options and hope to enable them by default in a future major version.

* `struts.ognl.allowStaticFieldAccess=false` - static methods are always blocked, but static fields can also optionally be blocked
* `struts.disallowProxyMemberAccess=true` - disallow proxied objects from being used in OGNL expressions as they may present a security risk
* `struts.disallowDefaultPackageAccess=true` - disallow access to classes in the default package which should not be used in production
* `struts.ognl.disallowCustomOgnlMap=true` - disallow construction of custom OGNL maps which can be used to bypass the SecurityMemberAccess policy

#### Allowlist Capability

> Note: since Struts 6.4.
Expand Down