Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2026-57281

CVE-2026-57281: Jenkins Script Security Plugin RCE Flaw

CVE-2026-57281 is a remote code execution vulnerability in Jenkins Script Security Plugin that allows attackers to bypass the Groovy sandbox and execute unauthorized code. This article covers technical details, affected versions, and mitigation.

Published:

CVE-2026-57281 Overview

CVE-2026-57281 affects the Jenkins Script Security Plugin version 1402.v94c9ce464861 and earlier. The plugin fails to reject Groovy Abstract Syntax Tree (AST) transformation annotations that carry an extensions member. Attackers with permission to run sandboxed Groovy scripts can leverage this gap to execute code outside the sandbox boundary. Successful exploitation requires a suitable script to exist on the classpath of the component evaluating the script. The flaw is classified under [CWE-93] (Improper Neutralization of CRLF Sequences) by NVD, though the underlying behavior is a sandbox escape via improper input validation.

Critical Impact

Authenticated attackers with sandboxed script execution rights can break out of the Groovy sandbox and execute arbitrary code within the Jenkins controller process.

Affected Products

  • Jenkins Script Security Plugin 1402.v94c9ce464861 and earlier
  • Jenkins controllers using sandboxed Groovy script execution
  • Pipeline and job configurations relying on Script Security for sandbox enforcement

Discovery Timeline

  • 2026-06-24 - Jenkins publishes Security Advisory SECURITY-3793
  • 2026-06-24 - CVE-2026-57281 published to NVD
  • 2026-06-25 - Last updated in NVD database

Technical Details for CVE-2026-57281

Vulnerability Analysis

The Jenkins Script Security Plugin enforces a sandbox around Groovy scripts executed by users without full administrative privileges. The sandbox restricts which classes, methods, and language features a script can invoke. CVE-2026-57281 weakens this enforcement by failing to filter Groovy AST transformation annotations.

Groovy supports compile-time metaprogramming through AST transformations, which modify code structure during compilation. Some transformation annotations accept an extensions member that points to additional classes loaded from the classpath. The Script Security Plugin does not reject this member, so a sandboxed script can reference an extension class that runs outside the sandbox during compilation.

If a class matching the attacker-supplied reference is present on the Jenkins controller classpath, the compiler loads and executes it. This effectively bypasses the sandbox before runtime checks take effect.

Root Cause

The root cause is missing validation of annotation members during AST processing. The plugin filters method calls and class references at script evaluation time but does not reject AST transformation annotations that pull in external code via extensions. This gap allows controlled code paths to load attacker-influenced classes during compilation.

Attack Vector

Exploitation requires Overall/Read or equivalent permission to submit a Groovy script for sandboxed execution. The attacker crafts a script containing an AST transformation annotation with an extensions member referencing a class already on the Jenkins classpath. When Jenkins compiles the script, the referenced class executes with the privileges of the Jenkins controller process.

The attack vector is network-based with high attack complexity, because the attacker must identify a suitable gadget class in the target environment. Successful exploitation grants code execution outside the sandbox, exposing Jenkins credentials, build artifacts, and connected infrastructure.

No public proof-of-concept exploit is currently available. The EPSS probability is 0.387% as of 2026-06-25.

Detection Methods for CVE-2026-57281

Indicators of Compromise

  • Sandboxed Groovy scripts containing AST transformation annotations such as @ASTTest, @Field, or custom transforms with an extensions parameter
  • Unexpected class loading events on the Jenkins controller during script compilation
  • Build console output showing Groovy compilation referencing classes outside the user-supplied script
  • New or modified pipeline definitions submitted by low-privilege users immediately followed by controller-side process spawns

Detection Strategies

  • Audit Jenkins job configurations and pipeline scripts for Groovy annotations that include an extensions member
  • Monitor the Jenkins audit log for script approval requests and script execution events tied to non-administrator accounts
  • Correlate Jenkins controller process creation events with preceding script submissions from sandboxed contexts
  • Review the Script Security Plugin version reported by the Jenkins update center against the fixed release

Monitoring Recommendations

  • Forward Jenkins controller logs and audit events to a centralized analytics platform for retention and correlation
  • Alert on child processes spawned by the Jenkins controller JVM that are inconsistent with normal build agent activity
  • Track changes to plugin versions and flag environments still running Script Security Plugin 1402.v94c9ce464861 or earlier
  • Watch for outbound network connections from the Jenkins controller to unexpected destinations following script execution

How to Mitigate CVE-2026-57281

Immediate Actions Required

  • Upgrade the Jenkins Script Security Plugin to a version later than 1402.v94c9ce464861 as listed in the Jenkins security advisory
  • Restrict the Overall/Read and Job/Configure permissions to trusted users until the patch is applied
  • Review existing pipeline scripts and job definitions for AST transformation annotations with extensions members
  • Rotate Jenkins credentials and API tokens if exploitation is suspected

Patch Information

Jenkins has released a fixed version of the Script Security Plugin. Refer to the Jenkins Security Advisory SECURITY-3793 for the exact patched version and upgrade instructions. Apply the update through the Jenkins update center and restart the controller to load the patched plugin.

Workarounds

  • Disable sandboxed script execution for untrusted users by revoking Job/Configure and Overall/Read permissions where feasible
  • Require administrator approval for all pipeline scripts via the In-process Script Approval mechanism
  • Remove unnecessary plugins from the Jenkins controller classpath to reduce the availability of gadget classes
  • Isolate the Jenkins controller on a restricted network segment to limit lateral movement after a successful sandbox escape
bash
# Check installed Script Security Plugin version via Jenkins CLI
java -jar jenkins-cli.jar -s https://jenkins.example.com/ \
  list-plugins script-security

# Trigger plugin update through the update center
java -jar jenkins-cli.jar -s https://jenkins.example.com/ \
  install-plugin script-security -restart

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.