CVE-2013-4660: Js yaml Deserialization Code Execution Vulnerability
CRITICALCVE-2013-4660 is a CRITICAL deserialization code execution vulnerability (CWE-20: Improper Input Validation) affecting Js yaml libraries in the npm ecosystem. The issue involves deserialization code execution in js-yaml. Remediation is available by upgrading affected packages to version 2.0.5.
CVE-2013-4660 at a Glance
How to Fix CVE-2013-4660
To remediate this vulnerability, upgrade all affected Js 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 js-yaml@2.0.5
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls js-yaml
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2013-4660, inspect your project dependencies using npm:
npm ls js-yaml
Analyze the terminal output to locate any version of Js yaml in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.0.5), your application is affected.
Note: The npm ls js-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-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In Js 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-2013-4660 Affected Js yaml Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
js-yaml
|
npm |
< 2.0.5
|
2.0.5
|
References
Frequently Asked Questions
What is CVE-2013-4660?
Which Js yaml versions are affected?
What version fixes CVE-2013-4660?
Is js-yaml affected?
What CWE is associated with CVE-2013-4660?
How can I check npm dependencies for CVE-2013-4660?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-xxvw-45rp-3mj2",
"modified" : "2021-09-22T18:27:56Z",
"published" : "2017-10-24T18:33:37Z",
"aliases" : [ "CVE-2013-4660" ],
"summary" : "Deserialization Code Execution in js-yaml",
"details" : "Versions 2.0.4 and earlier of `js-yaml` are affected by a code execution vulnerability in the YAML deserializer.\n\n## Proof of Concept\n```\nconst yaml = require('js-yaml');\n\nconst x = `test: !!js/function >\nfunction f() { \nconsole.log(1); \n}();`\n\nyaml.load(x);\n```\n\n\n## Recommendation\n\nUpdate js-yaml to version 2.0.5 or later, and ensure that all instances where the `.load()` method is called are updated to use `.safeLoad()` instead.",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "js-yaml"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.0.5"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2013-4660"
}, {
"type" : "ADVISORY",
"url" : "https://github.com/advisories/GHSA-xxvw-45rp-3mj2"
}, {
"type" : "WEB",
"url" : "https://nealpoole.com/blog/2013/06/code-execution-via-yaml-in-js-yaml-nodejs-module"
}, {
"type" : "WEB",
"url" : "https://www.npmjs.com/advisories/16"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-20" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2020-06-16T22:05:02Z",
"nvd_published_at" : null
}
}