GHSA-x9hc-rw35-f44h: Static eval Sandbox Breakout / Arbitrary Code Vulnerability
HIGHGHSA-x9hc-rw35-f44h is a HIGH (CVSS 7.3) sandbox breakout / arbitrary code vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Static eval libraries in the npm ecosystem. The issue involves sandbox breakout / arbitrary code execution in static-eval. Remediation is available by upgrading affected packages to version 2.0.2.
GHSA-x9hc-rw35-f44h at a Glance
Security Impact
CVSS: 7.3
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:L/I:L/A:L).
How to Fix GHSA-x9hc-rw35-f44h
To remediate this vulnerability, upgrade all affected Static eval 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 static-eval@2.0.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls static-eval
How to Check if You Are Affected
To determine whether your Node.js application is affected by GHSA-x9hc-rw35-f44h, inspect your project dependencies using npm:
npm ls static-eval
Analyze the terminal output to locate any version of Static eval in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.0.2), your application is affected.
Note: The npm ls static-eval 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-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In Static eval, 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
GHSA-x9hc-rw35-f44h Affected Static eval Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
static-eval
|
npm |
< 2.0.2
|
2.0.2
|
References
Frequently Asked Questions
What is GHSA-x9hc-rw35-f44h?
Which Static eval versions are affected?
What version fixes GHSA-x9hc-rw35-f44h?
Is static-eval affected?
What is the CVSS score of GHSA-x9hc-rw35-f44h?
What CWE is associated with GHSA-x9hc-rw35-f44h?
How can I check npm dependencies for GHSA-x9hc-rw35-f44h?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-x9hc-rw35-f44h",
"modified" : "2021-09-27T13:40:52Z",
"published" : "2020-09-02T15:46:03Z",
"aliases" : [ ],
"summary" : "Sandbox Breakout / Arbitrary Code Execution in static-eval",
"details" : "Versions of `static-eval`prior to 2.0.2 pass untrusted user input directly to the global function constructor, resulting in an arbitrary code execution vulnerability when user input is parsed via the package.\n\n## Proof of concept\n```\nvar evaluate = require('static-eval');\nvar parse = require('esprima').parse;\n\nvar src = process.argv[2];\nvar payload = '(function({x}){return x.constructor})({x:\"\".sub})(\"console.log(process.env)\")()'\nvar ast = parse(payload).body[0].expression;\nconsole.log(evaluate(ast, {x:1}));\n```\n\n\n## Recommendation\n\nUpgrade to version 2.0.2 or later.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "static-eval"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.0.2"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 2.0.1"
}
} ],
"references" : [ {
"type" : "PACKAGE",
"url" : "https://snyk.io/vuln/SNYK-JS-STATICEVAL-173693"
}, {
"type" : "WEB",
"url" : "https://www.npmjs.com/advisories/758"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-94" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2020-08-31T18:34:42Z",
"nvd_published_at" : null
}
}