Revert "Add String to the default whitelisted receivers"
This reverts commit f493b98259
.
This commit is contained in:
parent
f493b98259
commit
f610774546
|
@ -92,7 +92,6 @@ public class GroovySandboxExpressionChecker implements SecureASTCustomizer.Expre
|
||||||
private final static String[] defaultReceiverWhitelist = new String [] {
|
private final static String[] defaultReceiverWhitelist = new String [] {
|
||||||
groovy.util.GroovyCollections.class.getName(),
|
groovy.util.GroovyCollections.class.getName(),
|
||||||
java.lang.Math.class.getName(),
|
java.lang.Math.class.getName(),
|
||||||
java.lang.String.class.getName(),
|
|
||||||
java.lang.Integer.class.getName(), "[I", "[[I", "[[[I",
|
java.lang.Integer.class.getName(), "[I", "[[I", "[[[I",
|
||||||
java.lang.Float.class.getName(), "[F", "[[F", "[[[F",
|
java.lang.Float.class.getName(), "[F", "[[F", "[[[F",
|
||||||
java.lang.Double.class.getName(), "[D", "[[D", "[[[D",
|
java.lang.Double.class.getName(), "[D", "[[D", "[[[D",
|
||||||
|
|
|
@ -60,8 +60,6 @@ public class GroovySandboxScriptTests extends ElasticsearchIntegrationTest {
|
||||||
testSuccess("def t = Instant.now().getMillis()");
|
testSuccess("def t = Instant.now().getMillis()");
|
||||||
// GroovyCollections
|
// GroovyCollections
|
||||||
testSuccess("def n = [1,2,3]; GroovyCollections.max(n)");
|
testSuccess("def n = [1,2,3]; GroovyCollections.max(n)");
|
||||||
// String
|
|
||||||
testSuccess("def s = String.format(\\\"%d\\\", 4)");
|
|
||||||
|
|
||||||
// Fail cases
|
// Fail cases
|
||||||
testFailure("pr = Runtime.getRuntime().exec(\\\"touch /tmp/gotcha\\\"); pr.waitFor()",
|
testFailure("pr = Runtime.getRuntime().exec(\\\"touch /tmp/gotcha\\\"); pr.waitFor()",
|
||||||
|
|
Loading…
Reference in New Issue