Skip to content

Commit 63e7ed0

Browse files
author
substack
committed
don't assign onto __proto__
1 parent 47acf72 commit 63e7ed0

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ module.exports = function (args, opts) {
7070
var o = obj;
7171
keys.slice(0,-1).forEach(function (key) {
7272
if (o[key] === undefined) o[key] = {};
73+
if (o[key] === {}.__proto__) o[key] = {};
7374
o = o[key];
7475
});
7576

test/proto.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ var test = require('tape');
44
test('proto pollution', function (t) {
55
var argv = parse(['--__proto__.x','123']);
66
t.equal({}.x, undefined);
7+
t.equal(argv.__proto__.x, 123);
78
t.end();
89
});

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy