CVE-2022-43401: Critical severity Jenkins Script Security Jenkins vulnerability

Published Oct 19, 2022
·
Updated

A sandbox bypass vulnerability involving various casts performed implicitly by the Groovy language runtime in Jenkins Script Security Plugin 1183.v774b0b0aa451 and earlier allows 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.

Other sources

A sandbox bypass vulnerability was found in several Jenkins plugins. This could allow an authenticated attacker to execute arbitrary code within the Jenkins JVM controller. Exploitation could be achieved by crafting untrusted libraries or pipelines, compromising the integrity, availability, and confidentiality of 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 and Pipeline: Groovy Plugin:

- In Script Security Plugin 1183.v774b0b0aa451 and earlier and in Pipeline: Groovy Plugin 2802.v5ea628154bc2 and earlier, various casts performed implicitly by the Groovy language runtime were not intercepted by the sandbox. This includes casts performed when returning values from methods, when assigning local variables, fields, properties, and when defining default arguments for closure, constructor, and method parameters (CVE-2022-43401 in Script Security Plugin and CVE-2022-43402 in Pipeline: Groovy Plugin). - In Script Security Plugin 1183.v774b0b0aa451 and earlier, when casting an array-like value to an array type, per-element casts to the component type of the array are not intercepted by the sandbox (CVE-2022-43403). - In Script Security Plugin 1183.v774b0b0aa451 and earlier, crafted constructor bodies and calls to sandbox-generated synthetic constructors can be used to construct any subclassable type (due to an incomplete fix for SECURITY-1754 in the 2020-03-09 security advisory) (CVE-2022-43404).

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.\n\nThese vulnerabilities have been fixed:

- Script Security Plugin 1184.v85d16bd851b3 and Pipeline: Groovy Plugin 2803.v1af77ffcc773 intercept Groovy casts performed implicitly by the Groovy language runtime (CVE-2022-43401 in Script Security Plugin and CVE-2022-43402 in Pipeline: Groovy Plugin). - Script Security Plugin 1184.v85d16bd851b3 intercepts per-element casts when casting array-like values to array types (CVE-2022-43403). - Script Security Plugin 1184.v85d16bd851b3 rejects improper calls to sandbox-generated synthetic constructors (CVE-2022-43404).

Both plugins, Script Security Plugin and Pipeline: Groovy Plugin must be updated simultaneously. While Script Security Plugin could be updated independently, doing so would cause errors in Pipeline: Groovy Plugin due to an incompatible API change.

Affected Software

8 affected componentsFixes available
redhat/jenkins<2-plugins-0:4.11.1683009941-1.el8
2-plugins-0:4.11.1683009941-1.el8
redhat/jenkins<2-plugins-0:4.12.1675702407-1.el8
2-plugins-0:4.12.1675702407-1.el8
redhat/jenkins<2-plugins-0:4.10.1675144701-1.el8
2-plugins-0:4.10.1675144701-1.el8
redhat/jenkins<2-plugins-0:4.9.1675668922-1.el8
2-plugins-0:4.9.1675668922-1.el8
maven/org.jenkins-ci.plugins.workflow:workflow-cps<=2802.v5ea
2803.v1a_f77ffcc773
maven/org.jenkins-ci.plugins:script-security<1184.v85d16b
1184.v85d16b_d851b_3
redhat/Script Security Plugin<1184.
1184.
Jenkins Script Security Jenkins<=1183.v774b_0b_0a_a_451

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade redhat/jenkins to a version that resolves this vulnerability.

    Fixed in 2-plugins-0:4.11.1683009941-1.el8
  2. Upgrade

    Upgrade redhat/jenkins to a version that resolves this vulnerability.

    Fixed in 2-plugins-0:4.12.1675702407-1.el8
  3. Upgrade

    Upgrade redhat/jenkins to a version that resolves this vulnerability.

    Fixed in 2-plugins-0:4.10.1675144701-1.el8
  4. Upgrade

    Upgrade redhat/jenkins to a version that resolves this vulnerability.

    Fixed in 2-plugins-0:4.9.1675668922-1.el8
  5. Upgrade

    Upgrade maven/org.jenkins-ci.plugins.workflow:workflow-cps to a version that resolves this vulnerability.

    Fixed in 2803.v1a_f77ffcc773
  6. Upgrade

    Upgrade maven/org.jenkins-ci.plugins:script-security to a version that resolves this vulnerability.

    Fixed in 1184.v85d16b_d851b_3
  7. Upgrade

    Upgrade redhat/Script Security Plugin to a version that resolves this vulnerability.

    Fixed in 1184.
  8. Upgrade

    Upgrade jenkins/script-security-plugin to a version that resolves this vulnerability.

    Fixed in 1184.v85d16b_d851b_3Patch SECURITY-2824
  9. Upgrade

    Upgrade jenkins/pipeline-groovy-plugin to a version that resolves this vulnerability.

    Fixed in 2803.v1a_f77ffcc773Patch SECURITY-2824

Event History

Oct 19, 2022
CVE Published
via MITRE·12:00 AM
Data Sourced
via MITRE·12:00 AM
Description
Data Sourced
via NVD·04:15 PM
DescriptionSeverityAffected Software
Advisory Published
07:00 PM
Oct 20, 2022
Data Sourced
via Red Hat·06:28 AM
DescriptionSeverityAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2022-43401?

CVE-2022-43401 is classified as a high-severity vulnerability due to its potential to bypass sandbox protections.

2

How do I fix CVE-2022-43401?

To fix CVE-2022-43401, upgrade the Script Security Plugin to version 1184 or later.

3

What systems are affected by CVE-2022-43401?

CVE-2022-43401 affects Jenkins Script Security Plugin versions up to and including 1183.v774b_0b_0a_451.

4

What can be exploited in CVE-2022-43401?

CVE-2022-43401 can be exploited by attackers with permissions to run sandboxed scripts, allowing them to bypass the security measures in place.

5

Is there a permanent solution for CVE-2022-43401?

Yes, a permanent solution for CVE-2022-43401 is to update to the patched version of the Script Security Plugin.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203