test the security fix
This commit is contained in:
parent
08f1dcdaba
commit
4f42f4038c
2 changed files with 13 additions and 1 deletions
|
@ -33,6 +33,18 @@ describe('Pattern', () => {
|
|||
expect(count).to.equal(2)
|
||||
})
|
||||
})
|
||||
describe('Pattern.createPartForSet()', () => {
|
||||
it('Should not allow malicious assignment to Object.prototype', () => {
|
||||
const objProto = Object.prototype
|
||||
const Pattern = new Design()
|
||||
const pattern = new Pattern()
|
||||
|
||||
expect(() => pattern.createPartForSet('part', '__proto__')).to.throw(
|
||||
'malicious attempt at altering Object.prototype. Stopping action'
|
||||
)
|
||||
expect(objProto).to.equal(Object.prototype)
|
||||
})
|
||||
})
|
||||
it('Should check whether a part is needed', () => {
|
||||
const partA = {
|
||||
name: 'test.partA',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue