CVE-2021-4235 is a medium-severity (CVSS 5.5) vulnerability in gopkg.in/yaml.v2. 1 public exploit or proof-of-concept reference is indexed, so weaponization risk is real. A fix is available for gopkg.in/yaml.v2 — see the affected versions and patch details below.
YAML Go package vulnerable to denial of service
Exploitation Status
Proof-of-concept exploit code exists
- CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
Exploitation and automatability from CISA’s SSVC triage for CVE-2021-4235.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
gopkg.in/yaml.v2🐹github.com/go-yaml/yamlReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Go packages — download data is not available via public APIs for these ecosystems.
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.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐹Go | gopkg.in/yaml.v2 | all versions | 2.2.3go get gopkg.in/yaml.v2@v2.2.3 |
| 🐹Go | github.com/go-yaml/yaml | all versions | No fix |
Affected Products
yamlyaml_projectResearch use only. For defensive security, authorized penetration testing, and academic research only. Never execute exploit code against systems without explicit written authorization.
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for gopkg.in/yaml.v2, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update gopkg.in/yaml.v2 to 2.2.3 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2021-4235 is resolved across your whole dependency graph.
Workarounds
Cap what an attacker can consume: apply request size, rate and timeout limits in front of the affected component, and run it with memory and CPU limits so exhaustion degrades one worker rather than the whole service.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
| Product | Fixed in | Advisory |
|---|---|---|
| Red Hat OpenShift Container Platform 4.12 | openshift-clients-0:4.12.0-202301042257.p0.g854f807.assembly.stream.el8 | RHSA-2022:7398 |
| Red Hat OpenShift Container Platform 4.12 | openshift4/ose-installer:v4.12.0-202301271115.p0.g7fea1c4.assembly.stream | RHSA-2023:0569 |
| Red Hat OpenShift Container Platform 4.12 | openshift4/metallb-rhel8-operator:v4.12.0-202301301729.p0.g917cd33.assembly.stream | RHSA-2023:0570 |
| Red Hat OpenShift Container Platform 4.12 | openshift4/ose-openshift-controller-manager-rhel8:v4.12.0-202306090942.p0.gb6528f9.assembly.stream | RHSA-2023:3615 |
| Red Hat OpenShift Container Platform 4.13 | openshift4/ose-installer:v4.13.0-202305091542.p0.g44db7b2.assembly.stream | RHSA-2023:1326 |
| RHODF-4.13-RHEL-9 | odf4/mcg-rhel9-operator:v4.13.0-41 | RHSA-2023:3742 |
Frequently Asked Questions
Is CVE-2021-4235 in your dependencies?
Find it across Go, including transitive dependencies.