Vulnerabilities in pkg:golang/gopkg.in/yaml.v2

PACKAGE
Advisory Identifier: GHSA-6q6q-88xp-6f2r
Advisory Summary

CVE-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.

3 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:golang/gopkg.in/yaml.v2

3 Known Advisory Record(s)

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

CVE Identifier CVE-2022-3064
GHSA Identifier GHSA-6q6q-88xp-6f2r
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-400: Uncontrolled Resource Consumption
Affected Product Gopkg.in/yaml.v2
Package Ecosystem Go
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (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.

gopkg.in/yaml.v2 fixed: 2.2.4
Upgrade gopkg.in/yaml.v2 to 2.2.4
Verify Direct and Transitive Dependencies

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

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

CVE-2022-3064 Affected Gopkg.in/yaml.v2 Versions

1 component(s)
Fixed Versions:
2.2.4
Product / Package Ecosystem Affected Versions Fixed Version
gopkg.in/yaml.v2
Go
< 2.2.4
2.2.4

References

NVD — CVE-2022-3064 NVD
https://nvd.nist.gov/vuln/detail/CVE-2022-3064
Security Fix Commit FIX COMMIT
https://github.com/go-yaml/yaml/commit/f221b8435cfb71e54062f6c6e99e9ade30b124d5
Gopkg.in/yaml.v2 Source Repository REPOSITORY
https://github.com/go-yaml/yaml
Gopkg.in/yaml.v2 Release RELEASE
https://github.com/go-yaml/yaml/releases/tag/v2.2.4
lists.debian.org/debian-lts-announce... WEB
https://lists.debian.org/debian-lts-announce/2023/07/msg00001.html
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/4SBIUECMLNC572P23DDOKJNKPJVX26SP
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ANIOPUXWIHVRA6CEWXCGOMX3YYS6KFHG
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/LYZOKMMVX4SIEHPJW3SJUQGMO5YZCPHC
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/PW3XC47AUW5J5M2ULJX7WCCL3B2ETLMT
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/XNF4OLYZRQE75EB5TW5N42FSXHBXGWFE
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ZTE4ITXXPIWZEQ4HYQCB6N6GZIMWXDAI
pkg.go.dev/vuln/go-2022-0956 WEB
https://pkg.go.dev/vuln/GO-2022-0956

Frequently Asked Questions

What is CVE-2022-3064?
CVE-2022-3064 is a security vulnerability in Gopkg.in/yaml.v2 involving yaml package for Go can consume excessive amounts of CPU or memory under CWE-400: Uncontrolled Resource Consumption.
Which Gopkg.in/yaml.v2 versions are affected?
Affected versions include releases prior to 2.2.4 across affected packages: gopkg.in/yaml.v2.
What version fixes CVE-2022-3064?
Upgrading to 2.2.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is gopkg.in/yaml.v2 affected?
Yes, gopkg.in/yaml.v2 is affected in releases prior to 2.2.4. Upgrade your dependency to 2.2.4 or later.
What is the CVSS score of CVE-2022-3064?
CVE-2022-3064 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2022-3064?
CVE-2022-3064 is classified under CWE-400: Uncontrolled Resource Consumption (The product does not properly control the allocation and maintenance of a limited resource.).
How can I check Go dependencies for CVE-2022-3064?
Run the dependency tree command: 'inspect dependencies for gopkg.in/yaml.v2'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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"
  }
}