Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

libnested

Package Overview
Dependencies
Maintainers
2
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

libnested - npm Package Compare versions

Comparing version 1.5.1 to 1.5.2

10

index.js

@@ -25,3 +25,6 @@ function isObject (o, allowArray) {

if(isBasic(path)) return obj[path] = value
for(var i = 0; i < path.length; i++)
for(var i = 0; i < path.length; i++) {
if (isPrototypePolluted(path[i]))
continue
if(i === path.length - 1)

@@ -31,4 +34,5 @@ obj[path[i]] = value

obj = (obj[path[i]] = isNonNegativeInteger(path[i+1]) ? [] : {})
else if (!(isPrototypePolluted(path[i])))
else
obj = obj[path[i]]
}
return value

@@ -97,3 +101,3 @@ }

function isPrototypePolluted(key) {
return ['__proto__', 'constructor', 'prototype'].includes(key)
return ['__proto__', 'constructor', 'prototype'].includes(key.toString())
}

@@ -100,0 +104,0 @@

{
"name": "libnested",
"description": "",
"version": "1.5.1",
"version": "1.5.2",
"homepage": "https://github.com/dominictarr/libnested",

@@ -6,0 +6,0 @@ "repository": {

@@ -154,1 +154,12 @@

})
tape('prototype pollution', function (t) {
t.notEqual({}.polluted, 'yes')
R.set({}, ['__proto__','polluted'], 'yes');
t.notEqual({}.polluted, 'yes')
R.set({}, [['__proto__'], 'polluted'], 'yes')
t.notEqual({}.polluted, 'yes')
R.set({}, [['constructor', 'prototype'], 'polluted'], 'yes')
t.notEqual({}.polluted, 'yes')
t.end()
})
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc