Jeff Maass
Jeff Maass

Reputation: 3742

Jenkins : Groovy : Scripts not permitted to use method groovy.lang.GroovyObject getProperty java.lang.String

org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException:

Scripts not permitted to use method groovy.lang.GroovyObject

getProperty

java.lang.String (com.cccis.telematics.build.Templates.run_jgitflow_template)

at org.jenkinsci.plugins.scriptsecurity.sandbox.whitelists.StaticWhitelist.rejectMethod

(StaticWhitelist.java:180)

Upvotes: 5

Views: 15936

Answers (1)

Jeff Maass
Jeff Maass

Reputation: 3742

What happened here is that the property didn't exist as named on the object in question, so Groovy began introspecting the object looking for it. I suppose that allowing introspection could lead to security vulnerabilities.

reproduce:

class Foo
{
   String FOOSPRoperty
}

def a_method()
{
  Foo f = new Foo()
  f.foosPROPERTY.replace( "x", "y" )
}

Upvotes: 7

Related Questions