Skip to content

Commit 2e71611

Browse files
committed
minor refactor: clarify behaviour
1 parent 78215f0 commit 2e71611

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/main/java/org/codehaus/groovy/control/customizers/SecureASTCustomizer.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,9 +1064,12 @@ public List<String> getReceiversBlackList() {
10641064
* this class performs a static type check, it will be relatively
10651065
* simple to bypass any disallowed list unless the disallowed receivers list contains, at
10661066
* a minimum, Object, Script, GroovyShell, and Eval. Additionally,
1067-
* it is necessary to also have MethodPointerExpression in the
1068-
* disallowed expressions list for the disallowed receivers list to function
1069-
* as a security check.
1067+
* the disallowed expressions list must contain both
1068+
* {@link org.codehaus.groovy.ast.expr.MethodPointerExpression} and
1069+
* {@link org.codehaus.groovy.ast.expr.MethodReferenceExpression} for the disallowed
1070+
* receivers list to function as a security check. Both are needed because the expression
1071+
* lists are matched by exact class: naming a class does not name its subclasses, and the
1072+
* {@code ::} form of a method reference is a subclass of the {@code .&amp;} form.
10701073
*
10711074
* @param disallowedReceivers the list of refused classes, as fully qualified names
10721075
*/

0 commit comments

Comments
 (0)