Skip to content

Commit

Permalink
Fix: Possible prototype pollution if constructor were used in a dat…
Browse files Browse the repository at this point in the history
…a property name

418sec/huntr#827
  • Loading branch information
Allan Jardine committed Oct 25, 2020
1 parent d878f88 commit a51cbe9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion js/core/core.data.js
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ function _fnSetObjectDataFn( mSource )
for ( var i=0, iLen=a.length-1 ; i<iLen ; i++ )
{
// Protect against prototype pollution
if (a[i] === '__proto__') {
if (a[i] === '__proto__' || a[i] === 'constructor') {
throw new Error('Cannot set prototype values');
}

Expand Down

0 comments on commit a51cbe9

Please sign in to comment.