Advisory

GHSA-8j8c-7jfh-h6hx

Also known as: None

Summary

Code Injection in js-yaml

Details

Versions of js-yaml prior to 3.13.1 are vulnerable to Code Injection. The load() function may execute arbitrary code injected through a malicious YAML file. Objects that have toString as key, JavaScript code as value and are used as explicit mapping keys allow attackers to execute the supplied code through the load() function. The safeLoad() function is unaffected.

An example payload is
{ toString: !<tag:yaml.org,2002:js/function> 'function (){return Date.now()}' } : 1
which returns the object
{
"1553107949161": 1
}

Recommendation

Upgrade to version 3.13.1.

Severity

High Basis: The source's own band: HIGH

Dates

Published
2019-06-04 20:14 UTC
Modified
2020-08-31 18:36 UTC

Affected packages and fixes

js-yaml

npm · All systems

Affected

  • introduced 0, fixed 3.13.1 (semver)

Fixed versions

3.13.1

Fix

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences