Vulnerability in com.charleskorn.kaml:kaml (CVE-2021-39194)
Summary
Vulnerability in com.charleskorn.kaml:kaml (CVE-2021-39194). Risk of unauthorized operations or information disclosure. Mitigation: upgrade to 0.35.3 or later.
Original description
The description as published by the source.
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:
!
The following is a sample application that demonstrates this issue:
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 = """
!
"""
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.
Source: OSV.dev (Open Source Vulnerabilities) NVD GitHub Advisory OSV
Auto-generated summary
Assembled by SecPulse from the source data (CVSS, CWE, affected versions) using templates — no AI involved. Check the original description and references below for exact details.
A vulnerability tracked as CVE-2021-39194 has been found in com.charleskorn.kaml:kaml.
Risk of unauthorized operations or information disclosure.
What to do: upgrade com.charleskorn.kaml:kaml to 0.35.3 or later.
If unsure, ask your IT team or search "com.charleskorn.kaml:kaml CVE-2021-39194" on the vendor's site.
CVE-2021-39194 (com.charleskorn.kaml:kaml) — CWE-230
Attack vector: remote (network-reachable) / no user interaction
Patched: 0.35.3 — apply immediately
Plan: 1) Audit SBOM/dependencies, 2) Stage→prod upgrade, 3) Add WAF/proxy monitoring on affected endpoints, 4) Hunt IOCs in logs.
Refs: see the GHSA / vendor advisory / patched release linked on this page.
A vulnerability (CWE-230) exists in com.charleskorn.kaml:kaml.
Check the vendor advisory for the affected versions of com.charleskorn.kaml:kaml.
Severity: ?. Risk of unauthorized operations or information disclosure.
Update to 0.35.3.
Until the patch is applied: disable the affected feature, apply WAF rules, or restrict access via network ACLs.
Search webserver/proxy logs for unusual request patterns matching this CVE's known IOCs. Audit SBOM/dependencies to find affected services.
Response actions
Concrete steps and command examples for SOC/SRE teams to execute in order
-
1Identify exposure identify
Audit SBOM/dependencies for affected components.資産台帳・SBOM・依存マニフェストで com.charleskorn.kaml:kaml を使っているサービスとバージョンを洗い出す。
-
2Apply patch patch
Upgrade com.charleskorn.kaml:kaml to 0.35.3ステージング環境で 0.35.3 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。
-
3Post-deployment verification verify
Confirm patched version is live in productionパッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。
Affected packages
References
- advisory nvd.nist.gov
- web github.com
- web github.com
- web github.com
- web github.com