CVE-2021-4235 Denial of service in gopkg.in/yaml.v2
Attackers can cause denial of service by providing crafted YAML input to applications using the vulnerable Go YAML library.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Local or same network only
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2021-4235?
CVE-2021-4235 is a medium-severity denial of service vulnerability in github.com/go-yaml/yaml, published on 27 Dec 2022. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Official description
Due to unbounded alias chasing, a maliciously crafted YAML file can cause the system to consume significant system resources. If parsing user input, this may be used as a denial of service vector.
Which versions are affected by CVE-2021-4235?
6 open source packages ship an affected version, including github.com/go-yaml/yaml and gopkg.in/yaml.v2. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
github.com/go-yaml/yaml Go | All versions | None |
github.com/go-yaml/yaml Go | All versions to 2.1.0 | None |
github.com/go-yaml/yaml Go | All versions to 2.1.0 | None |
gopkg.in/yaml.v2 Go | All versions | 2.2.3 |
gopkg.in/yaml.v2 Go | All versions | 2.2.3 |
gopkg.in/yaml.v2 Go | All versions | 2.2.3 |
Products include Yaml Project Yaml.
How do I fix CVE-2021-4235?
Upgrade to a fixed version.
Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.
Is CVE-2021-4235 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2021-4235 exists.
Other vulnerabilities in github.com/go-yaml/yaml
Sources
Also known as AZL-43447, AZL-43642, AZL-43918, AZL-44229, AZL-45237, AZL-45360 and 5 more.