What’s Vulnerable › Vulnerabilities
CVE-2021-39194: Denial of service while parsing polymorphic input with tagged polymorphism style in kaml
- Severity: medium (CVSS 6.5 v3.1)
- Exploited in the wild: not listed in CISA KEV
- EPSS: 1.7% probability of exploitation in the next 30 days
- Public exploit or detection template: yes
- Published: 2021-09-07 · updated 2026-06-17
- Weakness: CWE-835
Description
kaml is an open source implementation of the YAML format with support for kotlinx.serialization. In affected versions 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. Version 0.35.3 or later contain the fix for this issue.
Affected products
- charleskorn kaml: before 0.35.3 — fixed in 0.35.3
How to fix
Upgrade to a fixed version: charleskorn kaml 0.35.3. Check the vendor advisory for mitigations.
References
- https://github.com/charleskorn/kaml/commit/e18785d043fc6324c81e968aae9764b4b060bc6a
- https://github.com/charleskorn/kaml/issues/179
- https://github.com/charleskorn/kaml/security/advisories/GHSA-fmm9-3gv8-58f4
- https://github.com/charleskorn/kaml/commit/e18785d043fc6324c81e968aae9764b4b060bc6a
- https://github.com/charleskorn/kaml/issues/179
- https://github.com/charleskorn/kaml/security/advisories/GHSA-fmm9-3gv8-58f4
Get alerted when CVE-2021-39194 or the next vulnerability affects your stack