CVE-2023-2251: Yaml Uncaught Exception Vulnerability
HIGHCVE-2023-2251 is a HIGH (CVSS 7.5) uncaught exception vulnerability (CWE-248: Uncaught Exception) affecting Yaml libraries in the npm ecosystem. The issue involves uncaught exception in yaml. Remediation is available by upgrading affected packages to version 2.2.2.
CVE-2023-2251 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-2023-2251
To remediate this vulnerability, upgrade all affected Yaml dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install yaml@2.2.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls yaml
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2023-2251, inspect your project dependencies using npm:
npm ls yaml
Analyze the terminal output to locate any version of Yaml in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.2.2), your application is affected.
Note: The npm ls yaml command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-248: Uncaught Exception, where an exception is thrown from a function, but it is not caught. In Yaml, 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-2023-2251 Affected Yaml Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
yaml
|
npm |
≥ 2.0.0-5
< 2.2.2
|
2.2.2
|
References
Frequently Asked Questions
What is CVE-2023-2251?
Which Yaml versions are affected?
What version fixes CVE-2023-2251?
Is yaml affected?
What is the CVSS score of CVE-2023-2251?
What CWE is associated with CVE-2023-2251?
How can I check npm dependencies for CVE-2023-2251?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-f9xv-q969-pqx4",
"modified" : "2023-05-03T18:36:52Z",
"published" : "2023-04-24T15:30:34Z",
"aliases" : [ "CVE-2023-2251" ],
"summary" : "Uncaught Exception in yaml",
"details" : "Uncaught Exception in GitHub repository eemeli/yaml starting at version 2.0.0-5 and prior to 2.2.2.",
"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" : "npm",
"name" : "yaml"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.0.0-5"
}, {
"fixed" : "2.2.2"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-2251"
}, {
"type" : "WEB",
"url" : "https://github.com/eemeli/yaml/commit/984f5781ffd807e58cad3b5c8da1f940dab75fba"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/eemeli/yaml"
}, {
"type" : "WEB",
"url" : "https://huntr.dev/bounties/4b494e99-5a3e-40d9-8678-277f3060e96c"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-248" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2023-04-24T18:05:30Z",
"nvd_published_at" : "2023-04-24T15:15:08Z"
}
}