Skip to content

Commit

Permalink
fix: explicitly ignore vulnerable properties
Browse files Browse the repository at this point in the history
  • Loading branch information
markwhitfeld committed Apr 26, 2023
1 parent 246252a commit d486007
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/parser.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ class exports.Parser extends events
@emit err

assignOrPush: (obj, key, newValue) =>
return if key == '__proto__'
return if key == 'constructor'
if key not of obj
if not @options.explicitArray
obj[key] = newValue
Expand Down Expand Up @@ -113,7 +115,7 @@ class exports.Parser extends events
if @options.mergeAttrs
@assignOrPush obj, processedKey, newValue
else
obj[attrkey][processedKey] = newValue
@assignOrPush obj[attrkey], processedKey, newValue

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

0 comments on commit d486007

Please sign in to comment.