Versions 2.0.4 and earlier of js-yaml
are affected by a code execution vulnerability in the YAML deserializer.
const yaml = require('js-yaml');
const x = `test: !!js/function >
function f() {
console.log(1);
}();`
yaml.load(x);
Update 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.
{ "nvd_published_at": null, "cwe_ids": [ "CWE-20" ], "severity": "CRITICAL", "github_reviewed": true, "github_reviewed_at": "2020-06-16T22:05:02Z" }