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

PACKAGE
Advisory Identifier: GHSA-hp87-p4gw-j4gq
Advisory Summary

CVE-2022-28948 is a HIGH (CVSS 7.5) denial of service vulnerability (CWE-502: Deserialization of Untrusted Data) affecting Gopkg.in/yaml.v3 libraries in the Go ecosystem. The issue involves gopkg.in/yaml.v3 denial of service. Remediation is available by upgrading affected packages to version 3.0.1.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:golang/gopkg.in/yaml.v3

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:golang/gopkg.in/yaml.v3. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-hp87-p4gw-j4gq CVE-2022-28948 HIGH gopkg.in/yaml.v3 Denial of Service

CVE-2022-28948 at a Glance

CVE Identifier CVE-2022-28948
GHSA Identifier GHSA-hp87-p4gw-j4gq
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-502: Deserialization of Untrusted Data
Affected Product Gopkg.in/yaml.v3
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-28948

To remediate this vulnerability, upgrade all affected Gopkg.in/yaml.v3 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.v3 fixed: 3.0.1
Upgrade gopkg.in/yaml.v3 to 3.0.1
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.v3

How to Check if You Are Affected

To determine whether your application is affected by CVE-2022-28948, inspect your project dependencies for Gopkg.in/yaml.v3:

inspect dependencies for gopkg.in/yaml.v3

Analyze the terminal output to locate any version of Gopkg.in/yaml.v3 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.0.1), 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-502: Deserialization of Untrusted Data, where the product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid. In Gopkg.in/yaml.v3, 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

An issue in the Unmarshal function in Go-Yaml v3 can cause a program to panic when attempting to deserialize invalid input.

CVE-2022-28948 Affected Gopkg.in/yaml.v3 Versions

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

References

Frequently Asked Questions

What is CVE-2022-28948?
CVE-2022-28948 is a security vulnerability in Gopkg.in/yaml.v3 involving gopkg.in/yaml.v3 Denial of Service under CWE-502: Deserialization of Untrusted Data.
Which Gopkg.in/yaml.v3 versions are affected?
Affected versions include releases prior to 3.0.1 across affected packages: gopkg.in/yaml.v3.
What version fixes CVE-2022-28948?
Upgrading to 3.0.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is gopkg.in/yaml.v3 affected?
Yes, gopkg.in/yaml.v3 is affected in releases prior to 3.0.1. Upgrade your dependency to 3.0.1 or later.
What is the CVSS score of CVE-2022-28948?
CVE-2022-28948 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-28948?
CVE-2022-28948 is classified under CWE-502: Deserialization of Untrusted Data (The product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid.).
How can I check Go dependencies for CVE-2022-28948?
Run the dependency tree command: 'inspect dependencies for gopkg.in/yaml.v3'. 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-hp87-p4gw-j4gq",
  "modified" : "2025-08-27T22:58:53Z",
  "published" : "2022-05-20T00:00:17Z",
  "aliases" : [ "CVE-2022-28948" ],
  "summary" : "gopkg.in/yaml.v3 Denial of Service",
  "details" : "An issue in the Unmarshal function in Go-Yaml v3 can cause a program to panic when attempting to deserialize invalid input.",
  "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.v3"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.0.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-28948"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/go-yaml/yaml/issues/665"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/go-yaml/yaml/issues/666"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/go-yaml/yaml/commit/8f96da9f5d5eff988554c1aae1784627c4bf6754"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/go-yaml/yaml/commit/f6f7691b1fdeb513f56608cd2c32c51f8194bf51"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/go-yaml/yaml"
  }, {
    "type" : "WEB",
    "url" : "https://security.netapp.com/advisory/ntap-20220923-0006"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-502" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-05-25T20:17:24Z",
    "nvd_published_at" : "2022-05-19T20:15:00Z"
  }
}