jenkinsci / jenkinsci/script-security-plugin
[JENKINS-46327] GString map identifiers don't work in sandboxed Groovy code
- Dominant language
- Java
- Stars
- 76
- Forks
- 181
- Avg merge
- 14h 55m
- Merged PRs (30d)
- 3
Description
The following code will fail in non-CPS-transformed sandboxed Groovy, but will pass in CPS-transformed-and-sandboxed Groovy or vanilla Groovy:
def m = [fruitA: 'apple', fruitB: 'banana']def bKey = 'B'
assert m."fruitB" == m."fruit${bKey}"
That's obviously wrong. Not sure yet where the problem is happening but will dig.
---
Originally reported by
abayer, imported from: GString map identifiers don't work in sandboxed Groovy code
Raw content of original issue
The following code will fail in non-CPS-transformed sandboxed Groovy, but will pass in CPS-transformed-and-sandboxed Groovy or vanilla Groovy:
def m = [fruitA: 'apple', fruitB: 'banana']def bKey = 'B'
assert m."fruitB" == m."fruit${bKey}"
That's obviously wrong. Not sure yet where the problem is happening but will dig.
- environment:
Script Security 1.33
Contributor guide
Assessment
This issue has not been assessed yet.