Jenkins:Groovy:不允许脚本使用方法 groovy.lang.GroovyObject getProperty java.lang.String

问题描述 投票:0回答:1

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

脚本不允许使用 groovy.lang.GroovyObject 方法

获取财产

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

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

(静态白名单.java:180)

jenkins groovy jenkins-pipeline jenkins-groovy
1个回答
7
投票

这里发生的情况是,该属性在相关对象上并不存在,因此 Groovy 开始内省该对象以查找它。我认为允许内省可能会导致安全漏洞。

重现:

class Foo
{
   String FOOSPRoperty
}

def a_method()
{
  Foo f = new Foo()
  f.foosPROPERTY.replace( "x", "y" )
}
© www.soinside.com 2019 - 2024. All rights reserved.