# CVE-2022-38752: DoS in SnakeYAML

> Attackers can cause a stack overflow and crash the application by supplying malicious YAML content to the SnakeYAML parser.

- **Severity:** Medium 6.5 (`CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 5 Sep 2022
- **Updated:** 3 Aug 2024
- **Also known as:** CLEANSTART-2026-EF95346, CLEANSTART-2026-HD46315, CLEANSTART-2026-UI28748, CLSA-2026-1774398089, DEBIAN-CVE-2022-38752, ECHO-c0ec-d93c-a0a9, GHSA-9w3m-gqgf-c4p9, MINI-5mg4-gp5j-95cf

## What is CVE-2022-38752?

CVE-2022-38752 is a medium-severity denial of service vulnerability in SnakeYAML, published on 5 Sep 2022. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

Using snakeYAML to parse untrusted YAML files may be vulnerable to Denial of Service attacks (DOS). If the parser is running on user supplied input, an attacker may supply content that causes the parser to crash by stack-overflow.

Weakness: CWE-787 (Out-of-bounds Write), CWE-121 (Stack-based Buffer Overflow)

## Which versions are affected by CVE-2022-38752?

2 open source packages ship an affected version, including org.yaml:snakeyaml. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `org.yaml:snakeyaml` | Maven | All versions | 1.32 |
| `org.yaml:snakeyaml` | Maven | All versions | 1.32 |

Products: Snakeyaml Project Snakeyaml.

## How do I fix CVE-2022-38752?

Upgrade org.yaml:snakeyaml to 1.32 or later.

## Is CVE-2022-38752 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2022-38752 exists.

## Other vulnerabilities in SnakeYAML

- [CVE-2022-1471](https://insights.sbomify.com/CVE-2022-1471/): Remote Code execution in SnakeYAML (high 8.3)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2022-38752 and fix it if it is affected.

What it is: CVE-2022-38752 is a medium-severity denial of service vulnerability in SnakeYAML, published on 5 Sep 2022. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2022-38752 exists.

Affected packages and fixed versions:
- org.yaml:snakeyaml (Maven): affected all versions; fixed in 1.32
- org.yaml:snakeyaml (Maven): affected all versions; fixed in 1.32

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2022-38752/ (Markdown: https://insights.sbomify.com/CVE-2022-38752/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2022-38752
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2022-38752
- OSV: https://osv.dev/vulnerability/CVE-2022-38752

---
From sbomify Insights: https://insights.sbomify.com/CVE-2022-38752/
Summaries are generated and may contain mistakes; the official description above is the record.
