Skip to content

vm.runInContext is memory unsafe and can be used to dump core #8537

Description

@deian
  • Version: 6.5.0
  • Platform:
  • Subsystem: vm

vm.runInContext is memory unsafe and can be used to dump core.

This doesn't seem like a serious security vulnerability (hence my reporting here), but can certainly be used to cause DOS and it might be nice to have a stdlib that is memory safe.

constvm=require('vm');consttarget={a : 1337};consthandler={getOwnPropertyDescriptor: (target,prop)=>{throw'w00t';// causes FromJust on line 128 of src/node_contextify.cc to dump core},};constsandbox=newProxy(target,handler);constcontext=newvm.createContext(sandbox);constscript=newvm.Script('');script.runInContext(context);

Related to: #8539, #8538, #7902

Metadata

Metadata

Assignees

No one assigned

    Labels

    c++Issues and PRs that require attention from people who are familiar with C++.vmIssues and PRs related to the vm subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions