Skip to content

Interesting security fix? #147

Answered by Tao-VanJS
lichwala asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @lichwala,

Thanks for your interest in VanJS.

I don't think either Object.create(...) or {__proto__: ..., ...} has any security issues. The problem in the 1.2.2 release is that the code is buggy. For Object.create, the 2nd parameter is a propertiesObject, not the object itself, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create#parameters. For instance, if you want to initiate {a: 1, b: 2} with Object.create, you need to pass in:

{
  a: {
    writable: true,
    configurable: true,
    value: 1,
  },
  b: {
    writable: true,
    configurable: true,
    value: 2,
  },
}

Thus 1.2.2 release was my fault. I should have run the tests to catc…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by Tao-VanJS
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants