Vulnerabilities in pkg:golang/gopkg.in/yaml.v2
PACKAGECVE-2022-3064 is a HIGH (CVSS 7.5) yaml package for go can vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Gopkg.in/yaml.v2 libraries in the Go ecosystem. The issue involves yaml package for go can consume excessive amounts of cpu or memory. Remediation is available by upgrading affected packages to version 2.2.4.
pkg:golang/gopkg.in/yaml.v2
Vulnerability advisories affecting package pkg:golang/gopkg.in/yaml.v2. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-6q6q-88xp-6f2r | CVE-2022-3064 | HIGH | yaml package for Go can consume excessive amounts of CPU or memory |
| GHSA-r88r-gmrh-7j83 | CVE-2021-4235 | MODERATE | YAML Go package vulnerable to denial of service |
| GHSA-wxc4-f4m6-wwqv | CVE-2019-11254 | MODERATE | Excessive Platform Resource Consumption within a Loop in Kubernetes |
CVE-2022-3064 at a Glance
Security Impact
CVSS: 7.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).
How to Fix CVE-2022-3064
To remediate this vulnerability, upgrade all affected Gopkg.in/yaml.v2 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade gopkg.in/yaml.v2 to 2.2.4
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for gopkg.in/yaml.v2
How to Check if You Are Affected
To determine whether your application is affected by CVE-2022-3064, inspect your project dependencies for Gopkg.in/yaml.v2:
inspect dependencies for gopkg.in/yaml.v2
Analyze the terminal output to locate any version of Gopkg.in/yaml.v2 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.2.4), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. In Gopkg.in/yaml.v2, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2022-3064 Affected Gopkg.in/yaml.v2 Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
gopkg.in/yaml.v2
|
Go |
< 2.2.4
|
2.2.4
|
References
Frequently Asked Questions
What is CVE-2022-3064?
Which Gopkg.in/yaml.v2 versions are affected?
What version fixes CVE-2022-3064?
Is gopkg.in/yaml.v2 affected?
What is the CVSS score of CVE-2022-3064?
What CWE is associated with CVE-2022-3064?
How can I check Go dependencies for CVE-2022-3064?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-6q6q-88xp-6f2r",
"modified" : "2025-04-14T22:10:15Z",
"published" : "2022-12-28T00:30:22Z",
"aliases" : [ "CVE-2022-3064" ],
"summary" : "yaml package for Go can consume excessive amounts of CPU or memory",
"details" : "Parsing malicious or large YAML documents can consume excessive amounts of CPU or memory",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "gopkg.in/yaml.v2"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.2.4"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-3064"
}, {
"type" : "WEB",
"url" : "https://github.com/go-yaml/yaml/commit/f221b8435cfb71e54062f6c6e99e9ade30b124d5"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/go-yaml/yaml"
}, {
"type" : "WEB",
"url" : "https://github.com/go-yaml/yaml/releases/tag/v2.2.4"
}, {
"type" : "WEB",
"url" : "https://lists.debian.org/debian-lts-announce/2023/07/msg00001.html"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/4SBIUECMLNC572P23DDOKJNKPJVX26SP"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ANIOPUXWIHVRA6CEWXCGOMX3YYS6KFHG"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/LYZOKMMVX4SIEHPJW3SJUQGMO5YZCPHC"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/PW3XC47AUW5J5M2ULJX7WCCL3B2ETLMT"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/XNF4OLYZRQE75EB5TW5N42FSXHBXGWFE"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ZTE4ITXXPIWZEQ4HYQCB6N6GZIMWXDAI"
}, {
"type" : "WEB",
"url" : "https://pkg.go.dev/vuln/GO-2022-0956"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-400" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2022-12-30T18:04:00Z",
"nvd_published_at" : "2022-12-27T22:15:00Z"
}
}