jenkinsci / jenkinsci/script-security-plugin

[JENKINS-52294] Cannot use index or range in sandboxed scripts

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

Description

At first, this issue looks like a duplicate of https://issues.jenkins-ci.org/browse/JENKINS-42618, but the difference here is the signature (object array instead of string):

org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use staticMethod org.codehaus.groovy.runtime.DefaultGroovyMethods getAt java.lang.Object[] groovy.lang.IntRange

The offending line:

version.split(/\./)[0..2]

 Where version is a string. It seems like the split converts the string to an object array.

---
Originally reported by towel, imported from: Cannot use index or range in sandboxed scripts


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

Raw content of original issue

At first, this issue looks like a duplicate of https://issues.jenkins-ci.org/browse/JENKINS-42618, but the difference here is the signature (object array instead of string):

org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use staticMethod org.codehaus.groovy.runtime.DefaultGroovyMethods getAt java.lang.Object[] groovy.lang.IntRange

The offending line:

version.split(/\./)[0..2]

 Where version is a string. It seems like the split converts the string to an object array.

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.