jenkinsci / jenkinsci/script-security-plugin

[JENKINS-28170] Named parameters are not supported in the sandbox

Open
#659 4 comments 0 reactions 0 assignees View on GitHub
component:script-security-plugin imported-jira-issue priority:major resolution:unresolved
Dominant language
Java
Stars
76
Forks
181
Avg merge
14h 55m
Merged PRs (30d)
3

Description

Using a DSL in a workflow script that has a method with named params e.g.

Object inside(String link = null, Closure body)

Calling it in the workflow (with sandbox mode turned ON) results in the following exception:

org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use method groovy.lang.GroovyObject invokeMethod java.lang.String java.lang.Object (DSL inside java.util.LinkedHashMap com.cloudbees.groovy.cps.impl.CpsClosure)

at org.jenkinsci.plugins.scriptsecurity.sandbox.whitelists.StaticWhitelist.rejectMethod(StaticWhitelist.java:155)
at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:77)
at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:60)

Quote from Jesse:


Not sure offhand how to fix; part of the general “Groovy hell” that is SandboxInterceptor: we get a high-level representation of a call point, and have to duplicate an incredibly complex system in Groovy to translate that to an actual Java method call.

---
Originally reported by tfennelly, imported from: Named parameters are not supported in the sandbox


  • status: Open
  • priority: Major
  • component(s): script-security-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 3
  • imported: 2025-12-09

Raw content of original issue

Using a DSL in a workflow script that has a method with named params e.g.


Object inside(String link = null, Closure body)


Calling it in the workflow (with sandbox mode turned ON) results in the following exception:


org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use method groovy.lang.GroovyObject invokeMethod java.lang.String java.lang.Object (DSL inside java.util.LinkedHashMap com.cloudbees.groovy.cps.impl.CpsClosure)

at org.jenkinsci.plugins.scriptsecurity.sandbox.whitelists.StaticWhitelist.rejectMethod(StaticWhitelist.java:155)
at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:77)
at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:60)

Quote from Jesse:


Not sure offhand how to fix; part of the general “Groovy hell” that is SandboxInterceptor: we get a high-level representation of a call point, and have to duplicate an incredibly complex system in Groovy to translate that to an actual Java method call.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.