Skip to content

Prototype pollution in function safeEval in the file index.js #26

Open
@lelecolacola123

Description

@lelecolacola123

Affected versions of this package are vulnerable to Prototype Pollution which can allow an attacker to add/modify properties of the Object.prototype.Consolidate runs the risk of Prototype Pollution when using the function safeEval.The function use vm lead an attacker to modify properties of the Object.prototype.the risk locate is in here

vm.runInNewContext(code, sandbox, opts)

and the POC is as follow:
var unsafe= require("safe-eval")
console.log({}.test) //undefined
unsafe("proto.test=123")
console.log({}.test) //123

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions