CVE-2022-38750: Snakeyaml Denial of Service Vulnerability
MODERATECVE-2022-38750 is a MODERATE (CVSS 5.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.
CVE-2022-38750 at a Glance
Security Impact
CVSS: 5.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H).
How to Fix CVE-2022-38750
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.
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>1.31</version>
</dependency>
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-38750, 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
CVE-2022-38750 Affected Snakeyaml Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
org.yaml:snakeyaml
|
Maven |
< 1.31
|
1.31
|
References
Frequently Asked Questions
What is CVE-2022-38750?
Which Snakeyaml versions are affected?
What version fixes CVE-2022-38750?
Is snakeyaml affected?
What is the CVSS score of CVE-2022-38750?
What CWE is associated with CVE-2022-38750?
How can I check Maven dependencies for CVE-2022-38750?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-hhhw-99gj-p3c3",
"modified" : "2024-03-15T12:30:35Z",
"published" : "2022-09-06T00:00:27Z",
"aliases" : [ "CVE-2022-38750" ],
"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:L/AC:L/PR:N/UI:R/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"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-38750"
}, {
"type" : "PACKAGE",
"url" : "https://bitbucket.org/snakeyaml/snakeyaml"
}, {
"type" : "WEB",
"url" : "https://bitbucket.org/snakeyaml/snakeyaml/issues/526/stackoverflow-oss-fuzz-47027"
}, {
"type" : "WEB",
"url" : "https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=47027"
}, {
"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-16T21:17:07Z",
"nvd_published_at" : "2022-09-05T10:15:00Z"
}
}