CVE-2021-4235 Denial of service in gopkg.in/yaml.v2

Medium 5.5 Published Updated

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.

PackageAffectedFixed in
github.com/go-yaml/yaml GoAll versionsNone
github.com/go-yaml/yaml GoAll versions to 2.1.0None
github.com/go-yaml/yaml GoAll versions to 2.1.0None
gopkg.in/yaml.v2 GoAll versions2.2.3
gopkg.in/yaml.v2 GoAll versions2.2.3
gopkg.in/yaml.v2 GoAll versions2.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.

Sources

Also known as AZL-43447, AZL-43642, AZL-43918, AZL-44229, AZL-45237, AZL-45360 and 5 more.

Is CVE-2021-4235 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free