Vulnerabilities in pkg:golang/gopkg.in/yaml.v3
PACKAGECVE-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.
pkg:golang/gopkg.in/yaml.v3
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
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-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.
Upgrade gopkg.in/yaml.v3 to 3.0.1
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
CVE-2022-28948 Affected Gopkg.in/yaml.v3 Versions
1 component(s)| 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?
Which Gopkg.in/yaml.v3 versions are affected?
What version fixes CVE-2022-28948?
Is gopkg.in/yaml.v3 affected?
What is the CVSS score of CVE-2022-28948?
What CWE is associated with CVE-2022-28948?
How can I check Go dependencies for CVE-2022-28948?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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"
}
}