1
0
Fork 0

security fix

This commit is contained in:
Enoch Riese 2022-12-08 19:31:57 -06:00
parent 91ece18d2b
commit 08f1dcdaba

View file

@ -121,6 +121,10 @@ Pattern.prototype.draft = function () {
}
Pattern.prototype.createPartForSet = function (partName, set = 0) {
// gotta protect against attacks
if (typeof set === '__proto__') {
throw new Error('malicious attempt at altering Object.prototype. Stopping action')
}
// Create parts
this.setStores[set].log.debug(`📦 Creating part \`${partName}\` (set ${set})`)
this.parts[set][partName] = this.__createPartWithContext(partName, set)