CVE-2022-0538: Jenkins core Denial of Service Vulnerability

MODERATE
Advisory Identifier: GHSA-34wx-x2w9-vqm3
CVSS 6.5
CWE-502
Published
Advisory Summary

CVE-2022-0538 is a MODERATE (CVSS 6.5) denial of service vulnerability (CWE-502: Deserialization of Untrusted Data) affecting Jenkins core libraries in the Maven ecosystem. The issue involves dos vulnerability in bundled xstream library in jenkins core. Remediation is available by upgrading affected packages to version 2.334, 2.319.3.

CVE-2022-0538 at a Glance

CVE Identifier CVE-2022-0538
GHSA Identifier GHSA-34wx-x2w9-vqm3
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-502: Deserialization of Untrusted Data
Affected Product Jenkins core
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 6.5

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:N/I:N/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 None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2022-0538

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

org.jenkins-ci.main:jenkins-core fixed: 2.334
<dependency>
    <groupId>org.jenkins-ci.main</groupId>
    <artifactId>jenkins-core</artifactId>
    <version>2.334</version>
</dependency>
org.jenkins-ci.main:jenkins-core fixed: 2.319.3
<dependency>
    <groupId>org.jenkins-ci.main</groupId>
    <artifactId>jenkins-core</artifactId>
    <version>2.319.3</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=org.jenkins-ci.main

How to Check if You Are Affected

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

mvn dependency:tree -Dincludes=org.jenkins-ci.main

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

Note: The mvn dependency:tree -Dincludes=org.jenkins-ci.main 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-502: Deserialization of Untrusted Data, where the product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid. In Jenkins core, 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

Jenkins 2.333 and earlier, LTS 2.319.2 and earlier is affected by the XStream library’s vulnerability [CVE-2021-43859](https://x-stream.github.io/CVE-2021-43859.html). This library is used by Jenkins to serialize and deserialize various XML files, like global and job `config.xml`, `build.xml`, and numerous others. This allows attackers able to submit crafted XML files to Jenkins to be parsed as configuration, e.g. through the `POST config.xml` API, to cause a denial of service (DoS).

CVE-2022-0538 Affected Jenkins core Versions

2 component(s)
Fixed Versions:
2.3342.319.3
Product / Package Ecosystem Affected Versions Fixed Version
org.jenkins-ci.main:jenkins-core
Maven
≥ 2.320
< 2.334
2.334
org.jenkins-ci.main:jenkins-core
Maven
< 2.319.3
2.319.3

References

Frequently Asked Questions

What is CVE-2022-0538?
CVE-2022-0538 is a security vulnerability in Jenkins core involving DoS vulnerability in bundled XStream library in Jenkins Core under CWE-502: Deserialization of Untrusted Data.
Which Jenkins core versions are affected?
Affected versions include releases prior to 2.334, 2.319.3 across affected packages: org.jenkins-ci.main:jenkins-core.
What version fixes CVE-2022-0538?
Upgrading to 2.334, 2.319.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is jenkins-core affected?
Yes, org.jenkins-ci.main:jenkins-core is affected in releases prior to 2.334, 2.319.3. Upgrade your dependency to 2.334, 2.319.3 or later.
What is the CVSS score of CVE-2022-0538?
CVE-2022-0538 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2022-0538?
CVE-2022-0538 is classified under CWE-502: Deserialization of Untrusted Data (The product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid.).
How can I check Maven dependencies for CVE-2022-0538?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.jenkins-ci.main'. 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-34wx-x2w9-vqm3",
  "modified" : "2023-12-22T13:51:07Z",
  "published" : "2022-02-10T00:00:30Z",
  "aliases" : [ "CVE-2022-0538" ],
  "summary" : "DoS vulnerability in bundled XStream library in Jenkins Core",
  "details" : "Jenkins 2.333 and earlier, LTS 2.319.2 and earlier is affected by the XStream library’s vulnerability [CVE-2021-43859](https://x-stream.github.io/CVE-2021-43859.html). This library is used by Jenkins to serialize and deserialize various XML files, like global and job `config.xml`, `build.xml`, and numerous others.\n\nThis allows attackers able to submit crafted XML files to Jenkins to be parsed as configuration, e.g. through the `POST config.xml` API, to cause a denial of service (DoS).",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.jenkins-ci.main:jenkins-core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.320"
      }, {
        "fixed" : "2.334"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.jenkins-ci.main:jenkins-core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.319.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-0538"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jenkinsci/jenkins/commit/8276aef4cc3dd81810fe6bdf6fa48141632c4636"
  }, {
    "type" : "WEB",
    "url" : "https://www.jenkins.io/security/advisory/2022-02-09/#SECURITY-2602"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2022/02/09/1"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-502" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-06-20T22:50:31Z",
    "nvd_published_at" : "2022-02-09T14:15:00Z"
  }
}