CVE-2022-43405: Pipeline groovy lib Groovy Libraries Plugin And Pipeline: Vulnerability

HIGH
Advisory Identifier: GHSA-4hjj-9gp7-4frg
CVSS 8.8
CWE-693
Published
Advisory Summary

CVE-2022-43405 is a HIGH (CVSS 8.8) groovy libraries plugin and pipeline: vulnerability (CWE-693: Protection Mechanism Failure) affecting Pipeline groovy lib libraries in the Maven ecosystem. The issue involves groovy libraries plugin and pipeline: deprecated groovy libraries plugin. Remediation is available by upgrading affected packages to version 613.v9c41a_160233f, 588.v576c103a_ff86.

CVE-2022-43405 at a Glance

CVE Identifier CVE-2022-43405
GHSA Identifier GHSA-4hjj-9gp7-4frg
Severity HIGH
CVSS v3.1 Base Score 8.8
CWE Classification CWE-693: Protection Mechanism Failure
Affected Product Pipeline groovy lib
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 8.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2022-43405

To remediate this vulnerability, upgrade all affected Pipeline groovy lib dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

io.jenkins.plugins:pipeline-groovy-lib fixed: 613.v9c41a_160233f
<dependency>
    <groupId>io.jenkins.plugins</groupId>
    <artifactId>pipeline-groovy-lib</artifactId>
    <version>613.v9c41a_160233f</version>
</dependency>
org.jenkins-ci.plugins.workflow:workflow-cps-global-lib fixed: 588.v576c103a_ff86
<dependency>
    <groupId>org.jenkins-ci.plugins.workflow</groupId>
    <artifactId>workflow-cps-global-lib</artifactId>
    <version>588.v576c103a_ff86</version>
</dependency>
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

mvn dependency:tree -Dincludes=io.jenkins.plugins

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2022-43405, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=io.jenkins.plugins

Analyze the terminal output to locate any version of Pipeline groovy lib in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 613.v9c41a_160233f), your application is affected.

Note: The mvn dependency:tree -Dincludes=io.jenkins.plugins command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-693: Protection Mechanism Failure, where the product does not use or incorrectly uses a protection mechanism that provides sufficient defense against directed attacks against the product. In Pipeline groovy lib, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

Pipeline: Groovy Libraries Plugin and older releases of the Pipeline: Deprecated Groovy Libraries Plugin (formerly Pipeline: Shared Groovy Libraries Plugin) define the l`ibrary` Pipeline step, which allows Pipeline authors to dynamically load Pipeline libraries. The return value of this step can be used to instantiate classes defined in the loaded library. In Pipeline: Groovy Libraries Plugin 612.v84da_9c54906d and earlier and in Pipeline: Deprecated Groovy Libraries Plugin 583.vf3b_454e43966 and earlier, the `library` step can be used to invoke sandbox-generated synthetic constructors in crafted untrusted libraries and construct any subclassable type. This is similar to SECURITY-582 in the [2017-08-07 security advisory](https://www.jenkins.io/security/advisory/2017-08-07/#multiple-groovy-language-features-allowed-script-security-plugin-sandbox-bypass), but in a different plugin. This vulnerability allows attackers with permission to define untrusted Pipeline libraries and to define and run sandboxed Pipelines, to bypass the sandbox protection and execute arbitrary code in the context of the Jenkins controller JVM. Pipeline: Groovy Libraries Plugin 613.v9c41a_160233f rejects improper calls to sandbox-generated synthetic constructors when using the `library` step. Pipeline: Deprecated Groovy Libraries Plugin 588.v576c103a_ff86 no longer contains the `library` step. It has been moved into the Pipeline: Groovy Libraries Plugin.

CVE-2022-43405 Affected Pipeline groovy lib Versions

2 component(s)
Fixed Versions:
613.v9c41a_160233f588.v576c103a_ff86
Product / Package Ecosystem Affected Versions Fixed Version
io.jenkins.plugins:pipeline-groovy-lib
Maven
< 613.v9c41a_160233f
613.v9c41a_160233f
org.jenkins-ci.plugins.workflow:workflow-cps-global-lib
Maven
< 588.v576c103a_ff86
588.v576c103a_ff86

References

Frequently Asked Questions

What is CVE-2022-43405?
CVE-2022-43405 is a security vulnerability in Pipeline groovy lib involving Groovy Libraries Plugin and Pipeline: Deprecated Groovy Libraries Plugin under CWE-693: Protection Mechanism Failure.
Which Pipeline groovy lib versions are affected?
Affected versions include releases prior to 613.v9c41a_160233f, 588.v576c103a_ff86 across affected packages: io.jenkins.plugins:pipeline-groovy-lib, org.jenkins-ci.plugins.workflow:workflow-cps-global-lib.
What version fixes CVE-2022-43405?
Upgrading to 613.v9c41a_160233f, 588.v576c103a_ff86 (or the latest patched release for your respective branch) resolves the vulnerability.
Is pipeline-groovy-lib affected?
Yes, io.jenkins.plugins:pipeline-groovy-lib is affected in releases prior to 613.v9c41a_160233f. Upgrade your dependency to 613.v9c41a_160233f or later.
Is workflow-cps-global-lib affected?
Yes, org.jenkins-ci.plugins.workflow:workflow-cps-global-lib is affected in releases prior to 588.v576c103a_ff86. Upgrade your dependency to 588.v576c103a_ff86 or later.
What is the CVSS score of CVE-2022-43405?
CVE-2022-43405 has a CVSS v3.1 base score of 8.8 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2022-43405?
CVE-2022-43405 is classified under CWE-693: Protection Mechanism Failure (The product does not use or incorrectly uses a protection mechanism that provides sufficient defense against directed attacks against the product.).
How can I check Maven dependencies for CVE-2022-43405?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=io.jenkins.plugins'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-4hjj-9gp7-4frg",
  "modified" : "2022-12-16T16:35:55Z",
  "published" : "2022-10-19T19:00:21Z",
  "aliases" : [ "CVE-2022-43405" ],
  "summary" : "Sandbox bypass vulnerability in Jenkins Pipeline: Groovy Libraries Plugin and Pipeline: Deprecated Groovy Libraries Plugin",
  "details" : "Pipeline: Groovy Libraries Plugin and older releases of the Pipeline: Deprecated Groovy Libraries Plugin (formerly Pipeline: Shared Groovy Libraries Plugin) define the l`ibrary` Pipeline step, which allows Pipeline authors to dynamically load Pipeline libraries. The return value of this step can be used to instantiate classes defined in the loaded library.\n\nIn Pipeline: Groovy Libraries Plugin 612.v84da_9c54906d and earlier and in Pipeline: Deprecated Groovy Libraries Plugin 583.vf3b_454e43966 and earlier, the `library` step can be used to invoke sandbox-generated synthetic constructors in crafted untrusted libraries and construct any subclassable type. This is similar to SECURITY-582 in the [2017-08-07 security advisory](https://www.jenkins.io/security/advisory/2017-08-07/#multiple-groovy-language-features-allowed-script-security-plugin-sandbox-bypass), but in a different plugin.\n\nThis vulnerability allows attackers with permission to define untrusted Pipeline libraries and to define and run sandboxed Pipelines, to bypass the sandbox protection and execute arbitrary code in the context of the Jenkins controller JVM.\n\nPipeline: Groovy Libraries Plugin 613.v9c41a_160233f rejects improper calls to sandbox-generated synthetic constructors when using the `library` step.\n\nPipeline: Deprecated Groovy Libraries Plugin 588.v576c103a_ff86 no longer contains the `library` step. It has been moved into the Pipeline: Groovy Libraries Plugin.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "io.jenkins.plugins:pipeline-groovy-lib"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "613.v9c41a_160233f"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "< 613.v9c41a"
    }
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.jenkins-ci.plugins.workflow:workflow-cps-global-lib"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "588.v576c103a_ff86"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 583.vf3b"
    }
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-43405"
  }, {
    "type" : "WEB",
    "url" : "https://www.jenkins.io/security/advisory/2022-10-19/#SECURITY-2824%20(2)"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2022/10/19/3"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-693" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-10-19T22:04:27Z",
    "nvd_published_at" : "2022-10-19T16:15:00Z"
  }
}