CVE-2021-39194
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.
如何修補 CVE-2021-39194
要修補 CVE-2021-39194,請將受影響套件升級到下列已修補版本。
- —升級至 0.35.3 或更新版本
CVE-2021-39194 正在被利用嗎?
低 — EPSS 為 0.5%,目前沒有觀察到大規模利用活動。
受影響套件(1)
- from 0, < 0.35.3