Summary
Code Injection in js-yaml
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
}
Impact
Untrusted input is evaluated as executable code within the application's runtime environment. Typical impact: arbitrary code execution within the application's privilege context.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
Upgrade to version 3.13.1.
Frequently Asked Questions
- What is GHSA-8J8C-7JFH-H6HX? GHSA-8J8C-7JFH-H6HX is a high-severity code injection vulnerability in js-yaml (npm), affecting versions < 3.13.1. It is fixed in 3.13.1. Untrusted input is evaluated as executable code within the application's runtime environment.
- Which versions of js-yaml are affected by GHSA-8J8C-7JFH-H6HX? js-yaml (npm) versions < 3.13.1 is affected.
- Is there a fix for GHSA-8J8C-7JFH-H6HX? Yes. GHSA-8J8C-7JFH-H6HX is fixed in 3.13.1. Upgrade to this version or later.
- Is GHSA-8J8C-7JFH-H6HX exploitable, and should I be worried? Whether GHSA-8J8C-7JFH-H6HX is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether GHSA-8J8C-7JFH-H6HX is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix GHSA-8J8C-7JFH-H6HX? Upgrade
js-yamlto 3.13.1 or later.