CVE-2021-39194 – com.charleskorn.kaml:kaml
Package
Manager: maven
Name: com.charleskorn.kaml:kaml
Vulnerable Version: >=0 <0.35.3
Severity
Level: Medium
CVSS v3.1: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:L
CVSS v4.0: CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N
EPSS: 0.00485 pctl0.64367
Details
Improper Handling of Missing Values in kaml ### Impact Attackers that could provide arbitrary YAML input to an application that uses kaml could cause the application to endlessly loop while parsing the input. This could result in resource starvation and denial of service. This only affects applications that use polymorphic serialization with the default tagged polymorphism style. Applications using the property polymorphism style are not affected. YAML input for a polymorphic type that provided a tag but no value for the object would trigger the issue, for example: ```yaml !<x> ``` The following is a sample application that demonstrates this issue: ```kotlin import com.charleskorn.kaml.Yaml import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable @Serializable private sealed class K { @Serializable @SerialName("x") data class X( val property: String? = null, ) : K() } const val s = """ !<x> """ fun main() { println("Started.") val result = Yaml.default.decodeFromString(K.serializer(), s) println("Finished, result is $result") } ``` On vulnerable versions of kaml, the `decodeFromString()` operation hangs and never returns. ### Patches Version 0.35.3 or later contain the fix for this issue.
Metadata
Created: 2021-09-07T23:08:40Z
Modified: 2021-09-08T14:47:32Z
Source: https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2021/09/GHSA-fmm9-3gv8-58f4/GHSA-fmm9-3gv8-58f4.json
CWE IDs: ["CWE-230", "CWE-835"]
Alternative ID: GHSA-fmm9-3gv8-58f4
Finding: F138
Auto approve: 1