Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 20ef0ef

Browse filesBrowse files
MatthiasKunnentimoxley
authored andcommitted
Fix prototype pollution on unflatten
Fixes #105.
1 parent e8fb281 commit 20ef0ef
Copy full SHA for 20ef0ef

File tree

Expand file treeCollapse file tree

1 file changed

+4
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-0
lines changed
Open diff view settings
Collapse file

‎index.js‎

Copy file name to clipboardExpand all lines: index.js
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,10 @@ function unflatten (target, opts) {
116116
let recipient = result
117117

118118
while (key2 !== undefined) {
119+
if (key1 === '__proto__') {
120+
return
121+
}
122+
119123
const type = Object.prototype.toString.call(recipient[key1])
120124
const isobject = (
121125
type === '[object Object]' ||

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.