Skip to content

Commit d486007

Browse files
committedApr 26, 2023
fix: explicitly ignore vulnerable properties
1 parent 246252a commit d486007

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed
 

‎src/parser.coffee

+3-1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ class exports.Parser extends events
5252
@emit err
5353

5454
assignOrPush: (obj, key, newValue) =>
55+
return if key == '__proto__'
56+
return if key == 'constructor'
5557
if key not of obj
5658
if not @options.explicitArray
5759
obj[key] = newValue
@@ -113,7 +115,7 @@ class exports.Parser extends events
113115
if @options.mergeAttrs
114116
@assignOrPush obj, processedKey, newValue
115117
else
116-
obj[attrkey][processedKey] = newValue
118+
@assignOrPush obj[attrkey], processedKey, newValue
117119

118120
# need a place to store the node name
119121
obj["#name"] = if @options.tagNameProcessors then processItem(@options.tagNameProcessors, node.name) else node.name

0 commit comments

Comments
 (0)
Please sign in to comment.