Jenkins Script Security Sandbox Bypass (CVE-2026-136835)
A Jenkins Script Security sandbox bypass lets pipeline authors run code in the controller JVM when a suitable class is present; fixed in 1436.1438.
TL;DR
- Jenkins Script Security missed
@Builderannotations written with a partially qualified name. Groovy then instantiated the named builder strategy at compile time, before the sandbox applied. - Script Security 1436.v1082791135e4 and earlier are affected. The fixed plugin is 1436.1438.v3dc5ef7d16f2. The attacker needs permission to define and run sandboxed scripts, including Pipelines, and a suitable class on the classpath.
- NVD rates the flaw CVSS v3.1 9.9 Critical (CWE-94); Jenkins rates it High and calls the suitable-class case rare. No public proof of concept or in-the-wild exploitation is published, and the CVE is not in CISA KEV as of 2026-11-25.
- Update Script Security to 1436.1438.v3dc5ef7d16f2 or later and restart Jenkins. See "How do I fix it?" for the plugin check and the interim permission control.
Am I affected?
You are exposed when Jenkins runs a Script Security plugin older than 1436.1438. The user must also be able to define or run sandboxed Pipelines on a controller that has a suitable class on its classpath.
All of these conditions must hold:
- The controller runs Script Security 1436.v1082791135e4 or earlier.
- The user has permission to define and run sandboxed scripts or Pipelines. That usually means Job/Configure and Build on a Pipeline job, or an equivalent role.
- The script can name a class on the controller's classpath whose no-argument constructor has a side effect the attacker wants.
- The
@Builderannotation is written in a form the old check did not resolve, such as a star import or a package declaration.
The advisory calls the suitable-class case rare, and it does not name a class. A deployment where only trusted administrators can create Pipelines is still exposed in principle, but the attacker must already hold a Jenkins account with pipeline rights.
| Component | Affected versions | Fixed version |
|---|---|---|
| Script Security plugin | 1436.v1082791135e4 and earlier | 1436.1438.v3dc5ef7d16f2 |
| Jenkins core needed by the fixed plugin | Before 2.479.3 | 2.479.3 or later |
The fixed plugin requires Jenkins 2.479.3 or later. Check the running core and the installed plugin version:
java -jar jenkins-cli.jar -s https://jenkins.example.com/ version
java -jar jenkins-cli.jar -s https://jenkins.example.com/ list-plugins | grep script-security
On the controller host, the plugin manifest is authoritative:
unzip -p "$JENKINS_HOME/plugins/script-security.jpi" META-INF/MANIFEST.MF | grep -E 'Plugin-Version|Jenkins-Version'
A Plugin-Version of 1436.1438.v3dc5ef7d16f2 or later means the fix is installed. An older value means the controller is still on the vulnerable line.
The Jenkins update center reported 245,107 current installations of the Script Security plugin on 2026-11-25, so the plugin is present on a large share of Jenkins controllers. The six most-installed versions in that report, 175,104 installations in total, are all older than the fixed version.
How do I fix it?
Update the Script Security plugin to 1436.1438.v3dc5ef7d16f2 or later and restart Jenkins so the new plugin classloader is active.
- Back up
$JENKINS_HOMEbefore you change plugins. - Update Script Security through Manage Plugins, or with the plugin manager CLI:
bash
jenkins-plugin-cli --plugins script-security:1436.1438.v3dc5ef7d16f2
- Restart Jenkins. A plugin update is not active until the controller restarts.
- Confirm the installed version with the manifest command from "Am I affected?".
- Update the companion plugins from the same advisory. Pipeline: Groovy 4403.4405.va_b_cdb_b_d0b_89f fixes CVE-2026-136834, a sandbox bypass through interface field initializers. Warnings 13.10365.10367.v2db_e2de17661 fixes CVE-2026-136837, which parses inline Groovy parser definitions on the controller.
If the controller is older than Jenkins 2.479.3, the fixed Script Security plugin cannot be installed. Upgrade Jenkins core first, then the plugin. Keep the controller on a supported release line; the advisory does not provide a backport for older cores.
If you cannot update today, restrict who can define and run Pipelines to people you would trust with controller-level code execution. Remove Job/Configure and Build from untrusted accounts, and review shared-library and pipeline-job creation rights. The advisory does not publish a configuration flag that disables the vulnerable annotation path, so the permission restriction is a containment, not a fix.
What is the root cause?
The sandbox's @Builder check resolved the annotation name only when it was fully qualified or imported as a single class. A partially qualified name such as @builder.Builder therefore skipped the check, and Groovy instantiated the attacker's builderStrategy class at compile time.
Script Security hooks Groovy's compilation with RejectASTTransformsCustomizer. One of its checks looks for @Builder, because Groovy's BuilderASTTransformation instantiates the class named by builderStrategy before it verifies that the class is a valid builder strategy. The constructor therefore runs outside the sandbox. The check must find the annotation before that instantiation.
The old resolver handled a name with no dot by looking at single-class imports, and it had a separate path for star imports:
private static boolean resolvedNameIn(@CheckForNull String name, Set<String> allowed, ModuleNode module, boolean allowStarImports) {
if (name == null) {
return false;
}
if (name.contains(".")) {
return allowed.contains(name);
}
for (ImportNode imp : module.getImports()) {
if (name.equals(imp.getAlias())) {
return allowed.contains(imp.getType().getName());
}
}
if (allowStarImports) {
for (ImportNode imp : module.getStarImports()) {
if (imp.getPackageName() != null && allowed.contains(imp.getPackageName() + name)) {
return true;
}
}
}
return false;
}
A name that contains a dot returns allowed.contains(name) immediately. A partially qualified name such as builder.Builder contains a dot but is not the fully qualified groovy.transform.builder.Builder, so the method returns false. The annotation is not recognized, the builderStrategy check does not run, and Groovy compiles the annotation.
The fix adds mayReferTo, which tries the single-class imports, the star imports and the package declaration for a short or partly qualified name. The annotation check now uses mayReferTo for @Builder. The strategy check still uses the strict resolvedNameIn, so a legitimate builder annotation with a partial name is accepted and a custom strategy is rejected.
How is it exploited?
A user who can submit a sandboxed Pipeline writes an @Builder annotation with a partially qualified name. The annotation names a builderStrategy class whose constructor performs the attacker's action. Groovy runs that constructor during compilation, before the sandbox wraps the script.
- The attacker opens a Pipeline job they can configure, or another sandboxed script entry point they can write.
- The script imports
groovy.transform.*and writes@builder.Builder(builderStrategy=<attacker-chosen class>)on a class. The partial name is valid Groovy because the star import supplies the rest. - The old
resolvedNameInsees a dot inbuilder.Builder, does not match the fully qualified annotation, and skips thebuilderStrategyvalidation. - Groovy's builder transformation instantiates the strategy class to compile the builder code. The no-argument constructor runs in the Jenkins controller JVM, outside the sandbox.
- The constructor's side effect executes with the Jenkins process identity. The attacker's further steps depend on what that class can do and on the classpath.
The advisory says a suitable class must be present, and it does not name one. The proof is the constructor running before the sandbox, not a published end-to-end chain. No public exploit code or in-the-wild exploitation is published as of 2026-11-25.
How does the attack flow?
A partially qualified @Builder name slips past the sandbox's annotation check. Groovy instantiates the named strategy class during compilation, and its constructor runs in the controller JVM before the sandbox applies.
What can an attacker do?
An attacker who reaches the constructor runs code as the Jenkins controller process, which can read the controller's credentials, configuration and job data.
The conditions from "Am I affected?" still apply. The plugin must be affected. The user must have permission to define and run sandboxed scripts, the annotation name must be partially qualified, and a suitable class must be on the classpath. The attacker is authenticated to Jenkins, so this is not an unauthenticated network flaw.
The controller process holds the credentials store, the agent launch secrets and the job configurations. Code in that process can use them, change builds, and reach the agents the controller manages. The advisory's "rare case" qualification is about finding a suitable class, not about the impact once the constructor runs.
The flaw is a sandbox escape, so the impact is not limited to the script's sandbox permissions. A user who can already run sandboxed Pipelines is normally contained; this path steps outside that containment.
Why does the fix work?
The fix resolves the annotation name through every prefix Groovy would try, so a partially qualified @Builder is recognized and its builderStrategy is checked before Groovy instantiates it.
+ private static boolean mayReferTo(String name, Set<String> candidates, @CheckForNull ModuleNode module) {
+ if (candidates.contains(name)) {
+ return true;
+ }
+ if (module == null) {
+ return false;
+ }
+ for (ImportNode imp : module.getImports()) {
+ if (name.equals(imp.getAlias())) {
+ return candidates.contains(imp.getType().getName());
+ }
+ }
+ for (ImportNode imp : module.getStarImports()) {
+ if (imp.getPackageName() != null && candidates.contains(imp.getPackageName() + name)) {
+ return true;
+ }
+ }
+ return module.getPackageName() != null && candidates.contains(module.getPackageName() + name);
+ }
...
- if (resolvedNameIn(an.getClassNode().getName(), BUILDER_ANNOTATIONS, source.getAST(), true)) {
+ if (mayReferTo(an.getClassNode().getName(), BUILDER_ANNOTATIONS, source.getAST())) {
mayReferTo checks the name as written, the single-class imports, the star imports and the package declaration. A star import of groovy.transform.* plus @builder.Builder now resolves to groovy.transform.builder.Builder, so the builderStrategy check runs.
The new resolvedNameIn fails closed for the strategy side: it accepts only a full name or a single-class import. A custom strategy named through a star import or a package prefix is rejected, because the check cannot prove it is one of Groovy's allowed strategies. The tests cover four spellings of the annotation and confirm that the side-effecting constructor never runs.
The fix is complete for the annotation-name gap the advisory describes. Jenkins says the issue is an incomplete fix of SECURITY-3925 (2); the new tests exercise the partial-name forms that the earlier fix missed.
How do I check if I was compromised?
No indicators of compromise are published. The useful check is for the script shape, because an attempt needs an @Builder annotation with a builderStrategy in a Pipeline definition or a shared library.
Search job configurations for the annotation:
grep -R -n --include=config.xml -E '@[Bb]uilder|builderStrategy' "$JENKINS_HOME/jobs"
Search shared libraries and script approvals for the same strings:
grep -R -n -E '@[Bb]uilder|builderStrategy' "$JENKINS_HOME/userContent" "$JENKINS_HOME/workspace" 2>/dev/null
A hit is a lead, not proof. Legitimate Pipelines use @Builder with Groovy's own strategies, and the annotation is not malicious by itself. Look for a builderStrategy that names a class outside groovy.transform.builder, and for a job or library change by an account that should not have pipeline rights.
Review the Jenkins audit log for plugin updates, job configuration changes and script approvals around the period you are investigating. An attempt that failed to find a suitable class can leave a compilation error in the build log and no other trace.
Timeline
- 2026-11-17: The Script Security fix commit for SECURITY-4278 is authored.
- 2026-11-18: Script Security 1436.1438.v3dc5ef7d16f2 is released.
- 2026-11-25: The Jenkins security advisory and CVE-2026-136835 are published.
FAQ
Is CVE-2026-136835 exploited in the wild?
No in-the-wild exploitation is published as of 2026-11-25. The CVE is not in CISA KEV, and the Jenkins advisory describes the mechanism without reporting attacks.
Is this an unauthenticated vulnerability?
No. The attacker needs permission to define and run sandboxed scripts, including Pipelines. The flaw is a sandbox escape for a user who already has that permission, not a pre-authentication network flaw.
Why does NVD say 9.9 when Jenkins says High?
NVD scores the sandbox escape with CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H for 9.9 Critical. Jenkins rates the same issue High and adds that a suitable class on the classpath is a rare case. Both ratings are in the record; the difference is the weighting of that precondition.
Which plugin version fixes it?
Script Security 1436.1438.v3dc5ef7d16f2 is the first fixed version. It requires Jenkins 2.479.3 or later. The current plugin release on 2026-11-25 is the same 1436.1438.v3dc5ef7d16f2.
Does the fix stop all sandbox escapes?
No. It closes the partial-name @Builder path in this advisory. The same advisory fixes a separate Pipeline: Groovy sandbox bypass through interface field initializers (CVE-2026-136834), so update that plugin too.
What if I cannot update today?
Restrict Job/Configure and Build on Pipeline jobs to trusted users, and review who can create or change shared libraries. The advisory provides no configuration switch for this path, so the permission restriction reduces exposure until you can update.
References
- Jenkins Security Advisory 2026-11-25, SECURITY-4278 (checked November 25, 2026)
- CVE-2026-136835 record (checked November 25, 2026)
- Script Security fix commit cb4e51537a37c766fd1c5ff404dab27a21f8ff4b (checked November 25, 2026)
- Script Security plugin 1436.1438.v3dc5ef7d16f2 (checked November 25, 2026)
- Script Security plugin statistics (checked November 25, 2026)
- CISA Known Exploited Vulnerabilities catalog (checked November 25, 2026)
Keep reading
