# CVE-2022-3064: Excessive resource consumption in gopkg.in/yaml.v2

> Attackers can cause denial of service by submitting malicious or large YAML documents to applications using the gopkg.in/yaml.v2 library.

- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 27 Dec 2022
- **Updated:** 14 Apr 2025
- **Also known as:** AZL-40841, AZL-43939, AZL-43993, AZL-44035, AZL-44067, AZL-44514, AZL-44610, CLEANSTART-2026-YU71715, CLSA-2025-1762422500, DEBIAN-CVE-2022-3064, GHSA-6q6q-88xp-6f2r, GO-2022-0956, RHSA-2023:1014, RHSA-2024:10759, RHSA-2024:10784, RHSA-2024:4443, UBUNTU-CVE-2022-3064

## What is CVE-2022-3064?

CVE-2022-3064 is a high-severity denial of service vulnerability in gopkg.in/yaml.v2, published on 27 Dec 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Parsing malicious or large YAML documents can consume excessive amounts of CPU or memory.

Weakness: CWE-400 (Uncontrolled Resource Consumption)

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

3 open source packages ship an affected version, including gopkg.in/yaml.v2. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `gopkg.in/yaml.v2` | Go | All versions | 2.2.4 |
| `gopkg.in/yaml.v2` | Go | All versions | 2.2.4 |
| `gopkg.in/yaml.v2` | Go | All versions | 2.2.4 |
| `rhc` | Red Hat:enterprise_linux:8::appstream | All versions | 1:0.2.5-1.el8_10 |
| `rhc-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 1:0.2.5-1.el8_10 |
| `rhc-debugsource` | Red Hat:enterprise_linux:8::appstream | All versions | 1:0.2.5-1.el8_10 |
| `rhc` | Red Hat:enterprise_linux:9::appstream | All versions | 1:0.2.5-1.el9_5 |
| `rhc-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 1:0.2.5-1.el9_5 |
| `rhc-debugsource` | Red Hat:enterprise_linux:9::appstream | All versions | 1:0.2.5-1.el9_5 |
| `rhc-debuginfo` | Red Hat:enterprise_linux:9::crb | All versions | 1:0.2.5-1.el9_5 |
| `rhc-debugsource` | Red Hat:enterprise_linux:9::crb | All versions | 1:0.2.5-1.el9_5 |
| `rhc-devel` | Red Hat:enterprise_linux:9::crb | All versions | 1:0.2.5-1.el9_5 |
| `etcd` | Red Hat:openstack:17.0::el9 | All versions | 0:3.4.14-3.el9ost |
| `etcd-debuginfo` | Red Hat:openstack:17.0::el9 | All versions | 0:3.4.14-3.el9ost |
| `etcd-debugsource` | Red Hat:openstack:17.0::el9 | All versions | 0:3.4.14-3.el9ost |
| `toolbox` | Red Hat:rhel_eus:9.2::appstream | All versions | 0:0.0.99.4-1.el9_2 |
| `toolbox-debuginfo` | Red Hat:rhel_eus:9.2::appstream | All versions | 0:0.0.99.4-1.el9_2 |
| `toolbox-debugsource` | Red Hat:rhel_eus:9.2::appstream | All versions | 0:0.0.99.4-1.el9_2 |
| `toolbox-tests` | Red Hat:rhel_eus:9.2::appstream | All versions | 0:0.0.99.4-1.el9_2 |

Products: Yaml Project Yaml.

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

Upgrade gopkg.in/yaml.v2 to 2.2.4 or later.

## Is CVE-2022-3064 being exploited?

There is no known exploitation of CVE-2022-3064 in the wild and no public exploit code.

## Other vulnerabilities in gopkg.in/yaml.v2

- [CVE-2023-2251](https://insights.sbomify.com/CVE-2023-2251/): Uncaught Exception in eemeli/yaml (high 7.5)
- [CVE-2021-4235](https://insights.sbomify.com/CVE-2021-4235/): Denial of service in gopkg.in/yaml.v2 (medium 5.5)

## Fix prompt for AI coding agents

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

What it is: CVE-2022-3064 is a high-severity denial of service vulnerability in gopkg.in/yaml.v2, published on 27 Dec 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2022-3064 in the wild and no public exploit code.

Affected packages and fixed versions:
- gopkg.in/yaml.v2 (Go): affected all versions; fixed in 2.2.4
- gopkg.in/yaml.v2 (Go): affected all versions; fixed in 2.2.4
- gopkg.in/yaml.v2 (Go): affected all versions; fixed in 2.2.4

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-3064/ (Markdown: https://insights.sbomify.com/CVE-2022-3064/index.md)
```

## Sources

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

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