-
Improvement
-
Resolution: Fixed
-
Major
-
None
Consider a closure attempts to call methods/properties like the following:
class Foo { def foo() {} } def c = { -> foo(); } c.delegate = new Foo(); c();
script-security currently tries to check the access at GroovyObject.invokeMethod. For example, the above would be rejected like this:
org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use method groovy.lang.GroovyObject invokeMethod java.lang.String java.lang.Object (Script1$_run_closure1 foo)
This is hardly useful, because GroovyObject.invokeMethod is too generic to whitelist. It's much more sensible to figure out where this call is actually handled (in this case Foo.foo, then check the access of the target (in the case above this would have been allowed via ClassLoaderWhitelist)
- is related to
-
JENKINS-28587 Whitelist should have access to root Whitelist
-
- Open
-
- links to
Code changed in jenkins
User: Kohsuke Kawaguchi
Path:
src/main/resources/org/jenkinsci/plugins/scriptsecurity/sandbox/whitelists/generic-whitelist
src/test/java/org/jenkinsci/plugins/scriptsecurity/sandbox/groovy/SandboxInterceptorTest.java
http://jenkins-ci.org/commit/script-security-plugin/662ded007f1adc146190f7b94ab6be7487edd877
Log:
JENKINS-28586A test case as the baseline.