Vulnerabilities in pkg:maven/org.testifyproject.external/external-snakeyaml

PACKAGE
Advisory Identifier: GHSA-c4r9-r8fh-9vj2
Advisory Summary

CVE-2022-38749 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.31 vulnerable to denial of service due to out-of-bounds write. Remediation is available by upgrading affected packages to version 1.31.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:maven/org.testifyproject.external/external-snakeyaml

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:maven/org.testifyproject.external/external-snakeyaml. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-c4r9-r8fh-9vj2 CVE-2022-38749 MODERATE snakeYAML before 1.31 vulnerable to Denial of Service due to Out-of-bounds Write

CVE-2022-38749 at a Glance

CVE Identifier CVE-2022-38749
GHSA Identifier GHSA-c4r9-r8fh-9vj2
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-38749

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.31
<dependency>
    <groupId>org.yaml</groupId>
    <artifactId>snakeyaml</artifactId>
    <version>1.31</version>
</dependency>
be.cylab:snakeyaml fixed: Latest secure release
<dependency>
    <groupId>be.cylab</groupId>
    <artifactId>snakeyaml</artifactId>
    <version>Latest secure release</version>
</dependency>
com.alipay.sofa.acts:acts-common-util fixed: Latest secure release
<dependency>
    <groupId>com.alipay.sofa.acts</groupId>
    <artifactId>acts-common-util</artifactId>
    <version>Latest secure release</version>
</dependency>
io.prometheus.jmx:jmx_prometheus_httpserver fixed: Latest secure release
<dependency>
    <groupId>io.prometheus.jmx</groupId>
    <artifactId>jmx_prometheus_httpserver</artifactId>
    <version>Latest secure release</version>
</dependency>
io.prometheus.jmx:jmx_prometheus_httpserver_java6 fixed: Latest secure release
<dependency>
    <groupId>io.prometheus.jmx</groupId>
    <artifactId>jmx_prometheus_httpserver_java6</artifactId>
    <version>Latest secure release</version>
</dependency>
org.testifyproject.external:external-snakeyaml fixed: Latest secure release
<dependency>
    <groupId>org.testifyproject.external</groupId>
    <artifactId>external-snakeyaml</artifactId>
    <version>Latest secure release</version>
</dependency>
pl.droidsonroids.yaml:snakeyaml fixed: Latest secure release
<dependency>
    <groupId>pl.droidsonroids.yaml</groupId>
    <artifactId>snakeyaml</artifactId>
    <version>Latest secure release</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-38749, 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.31), 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 stackoverflow.

CVE-2022-38749 Affected Snakeyaml Versions

7 component(s)
Fixed Versions:
1.31
Product / Package Ecosystem Affected Versions Fixed Version
org.yaml:snakeyaml
Maven
< 1.31
1.31
be.cylab:snakeyaml
Maven
1.25.1
All 1 versions
1.25.1
None specified
com.alipay.sofa.acts:acts-common-util
Maven
1.0.0
All 1 versions
1.0.0
None specified
io.prometheus.jmx:jmx_prometheus_httpserver
Maven
0.17.0
All 1 versions
0.17.0
None specified
io.prometheus.jmx:jmx_prometheus_httpserver_java6
Maven
≤ 0.18.0
org.testifyproject.external:external-snakeyaml
Maven
≤ 1.0.6
pl.droidsonroids.yaml:snakeyaml
Maven
≤ 1.18.2

References

Frequently Asked Questions

What is CVE-2022-38749?
CVE-2022-38749 is a security vulnerability in Snakeyaml involving snakeYAML before 1.31 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.31 across affected packages: org.yaml:snakeyaml, be.cylab:snakeyaml, com.alipay.sofa.acts:acts-common-util, io.prometheus.jmx:jmx_prometheus_httpserver, io.prometheus.jmx:jmx_prometheus_httpserver_java6, org.testifyproject.external:external-snakeyaml, pl.droidsonroids.yaml:snakeyaml.
What version fixes CVE-2022-38749?
Upgrading to 1.31 (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.31, Latest secure release. Upgrade your dependency to 1.31, Latest secure release or later.
Is acts-common-util affected?
Yes, com.alipay.sofa.acts:acts-common-util is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of CVE-2022-38749?
CVE-2022-38749 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-38749?
CVE-2022-38749 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-38749?
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-c4r9-r8fh-9vj2",
  "modified" : "2024-03-15T12:30:35Z",
  "published" : "2022-09-06T00:00:27Z",
  "aliases" : [ "CVE-2022-38749" ],
  "summary" : "snakeYAML before 1.31 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 stackoverflow.",
  "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.31"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "be.cylab:snakeyaml"
    },
    "versions" : [ "1.25.1" ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "com.alipay.sofa.acts:acts-common-util"
    },
    "versions" : [ "1.0.0" ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "io.prometheus.jmx:jmx_prometheus_httpserver"
    },
    "versions" : [ "0.17.0" ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "io.prometheus.jmx:jmx_prometheus_httpserver_java6"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "0.18.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.testifyproject.external:external-snakeyaml"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "1.0.6"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "pl.droidsonroids.yaml:snakeyaml"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "1.18.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-38749"
  }, {
    "type" : "WEB",
    "url" : "https://arxiv.org/pdf/2306.05534.pdf"
  }, {
    "type" : "PACKAGE",
    "url" : "https://bitbucket.org/snakeyaml/snakeyaml"
  }, {
    "type" : "WEB",
    "url" : "https://bitbucket.org/snakeyaml/snakeyaml/issues/525/got-stackoverflowerror-for-many-open"
  }, {
    "type" : "WEB",
    "url" : "https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=47024"
  }, {
    "type" : "WEB",
    "url" : "https://lists.debian.org/debian-lts-announce/2022/10/msg00001.html"
  }, {
    "type" : "WEB",
    "url" : "https://security.gentoo.org/glsa/202305-28"
  }, {
    "type" : "WEB",
    "url" : "https://security.netapp.com/advisory/ntap-20240315-0010"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-121", "CWE-787" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-09-15T03:27:43Z",
    "nvd_published_at" : "2022-09-05T10:15:00Z"
  }
}