GHSA-5mjw-6jrh-hvfq

    Dashboard / Vulnerabilities / GHSA-5mjw-6jrh-hvfq

    GHSA-5mjw-6jrh-hvfq

    Published: 6 Aug 2018Last Modified: 8 Nov 2023

    Summary: Sandbox Breakout / Arbitrary Code Execution in static-eval

    Details: Affected versions of `static-eval` 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 ```js var evaluate = require('static-eval'); var parse = require('esprima').parse; var src = '(function(){console.log(process.pid)})()'; var ast = parse(src).body[0].expression; var res = evaluate(ast, {}); // Will print the process id ``` ## Recommendation Update to version 2.0.0 or later.

    Affected packages

    Package

    Name: static-eval

    Purl: pkg:npm/static-eval

    Affected ranges

    Type: SEMVER

    Events:

    Introduced- 0
    Fixed -2.0.0

    Affected versions

    Common Vulnerability Scoring System

    Attack Vector
    Network
    Adjacent
    Local
    Physical
    Privileges Required
    None
    Low
    High
    User Interaction
    None
    Required
    Scope
    Unchanged
    Changed
    Confidentiality
    None
    Low
    High
    Integrity
    None
    Low
    High
    Availability
    None
    Low
    High
    GHSA-5mjw-6jrh-hvfq | CVE-DB