CVE-2022-38752: Snakeyaml Denial of Service Vulnerability

MODERATE
Advisory Identifier: GHSA-9w3m-gqgf-c4p9
CVSS 6.5
CWE-121 CWE-787
Published
Advisory Summary

CVE-2022-38752 is a MODERATE (CVSS 6.5) denial of service vulnerability (CWE-121: Stack-based Buffer Overflow) affecting Snakeyaml libraries in the Maven ecosystem. The issue involves snakeyaml before 1.32 vulnerable to denial of service due to out-of-bounds write. Remediation is available by upgrading affected packages to version 1.32.

CVE-2022-38752 at a Glance

CVE Identifier CVE-2022-38752
GHSA Identifier GHSA-9w3m-gqgf-c4p9
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-121: Stack-based Buffer Overflow
Affected Product Snakeyaml
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-38752

To remediate this vulnerability, upgrade all affected Snakeyaml 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.yaml:snakeyaml fixed: 1.32
<dependency>
    <groupId>org.yaml</groupId>
    <artifactId>snakeyaml</artifactId>
    <version>1.32</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.yaml

How to Check if You Are Affected

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

mvn dependency:tree -Dincludes=org.yaml

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

Note: The mvn dependency:tree -Dincludes=org.yaml 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-121: Stack-based Buffer Overflow, where a stack-based buffer overflow condition is a condition where the buffer being overwritten is allocated on the stack (i.e., is a local variable or, rarely, a parameter to a function). In Snakeyaml, 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

Using snakeYAML to parse untrusted YAML files may be vulnerable to Denial of Service attacks (DoS). If the parser is running on user supplied input, an attacker may supply content that causes the parser to crash by stack-overflow.

CVE-2022-38752 Affected Snakeyaml Versions

1 component(s)
Fixed Versions:
1.32
Product / Package Ecosystem Affected Versions Fixed Version
org.yaml:snakeyaml
Maven
< 1.32
1.32

References

Frequently Asked Questions

What is CVE-2022-38752?
CVE-2022-38752 is a security vulnerability in Snakeyaml involving snakeYAML before 1.32 vulnerable to Denial of Service due to Out-of-bounds Write under CWE-121: Stack-based Buffer Overflow.
Which Snakeyaml versions are affected?
Affected versions include releases prior to 1.32 across affected packages: org.yaml:snakeyaml.
What version fixes CVE-2022-38752?
Upgrading to 1.32 (or the latest patched release for your respective branch) resolves the vulnerability.
Is snakeyaml affected?
Yes, org.yaml:snakeyaml is affected in releases prior to 1.32. Upgrade your dependency to 1.32 or later.
What is the CVSS score of CVE-2022-38752?
CVE-2022-38752 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-38752?
CVE-2022-38752 is classified under CWE-121: Stack-based Buffer Overflow (A stack-based buffer overflow condition is a condition where the buffer being overwritten is allocated on the stack (i.e., is a local variable or, rarely, a parameter to a function).).
How can I check Maven dependencies for CVE-2022-38752?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.yaml'. 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-9w3m-gqgf-c4p9",
  "modified" : "2024-03-15T12:30:35Z",
  "published" : "2022-09-06T00:00:27Z",
  "aliases" : [ "CVE-2022-38752" ],
  "summary" : "snakeYAML before 1.32 vulnerable to Denial of Service due to Out-of-bounds Write",
  "details" : "Using snakeYAML to parse untrusted YAML files may be vulnerable to Denial of Service attacks (DoS). If the parser is running on user supplied input, an attacker may supply content that causes the parser to crash by stack-overflow.",
  "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.yaml:snakeyaml"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.32"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-38752"
  }, {
    "type" : "PACKAGE",
    "url" : "https://bitbucket.org/snakeyaml/snakeyaml"
  }, {
    "type" : "WEB",
    "url" : "https://bitbucket.org/snakeyaml/snakeyaml/issues/531/stackoverflow-oss-fuzz-47081"
  }, {
    "type" : "WEB",
    "url" : "https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=47081"
  }, {
    "type" : "WEB",
    "url" : "https://security.gentoo.org/glsa/202305-28"
  }, {
    "type" : "WEB",
    "url" : "https://security.netapp.com/advisory/ntap-20240315-0009"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-121", "CWE-787" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-09-13T21:29:45Z",
    "nvd_published_at" : "2022-09-05T10:15:00Z"
  }
}