Skip to content

Object properties should be created using defineProperty #164

Closed
@monsanto

Description

@monsanto

This is how JSON.parse works, and it allows one to bypass setters on Object.prototype such as __proto__. Compare:

> require('js-yaml').safeLoad('{"__proto__": "test"}').__proto__
{}
> JSON.parse('{"__proto__": "test"}').__proto__
'test'

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions