Jenkins Script Security Plugin provides a sandbox feature that allows low privileged users to define scripts, including Pipelines, that are generally safe to execute. Calls to code defined inside a sandboxed script are intercepted, and various allowlists are checked to determine whether the call is to be allowed.
Multiple sandbox bypass vulnerabilities exist in Script Security Plugin 1335.vf07d9ce377a_e and earlier:
Crafted constructor bodies that invoke other constructors can be used to construct any subclassable type via implicit casts.
Sandbox-defined Groovy classes that shadow specific non-sandbox-defined classes can be used to construct any subclassable type.
These vulnerabilities allow attackers with permission to define and run sandboxed scripts, including Pipelines, to bypass the sandbox protection and execute arbitrary code in the context of the Jenkins controller JVM.
Script Security Plugin 1336.vf33aa9863911 has additional restrictions and sanity checks to ensure that super constructors cannot be constructed without being intercepted by the sandbox:
Calls to to other constructors using this are now intercepted by the sandbox.
Classes in packages that can be shadowed by Groovy-defined classes are no longer ignored by the sandbox when intercepting super constructor calls.
{ "nvd_published_at": "2024-05-02T14:15:10Z", "cwe_ids": [ "CWE-693" ], "severity": "HIGH", "github_reviewed": true, "github_reviewed_at": "2024-05-03T20:14:29Z" }