Skip to content

Commit 2da4cc5

Browse files
committed
Added test for prototype pollution
1 parent 2789069 commit 2da4cc5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,4 +130,13 @@ describe('XML Body Parser', function () {
130130
.send('x<foo>test</foo><bar>test</bar></data>')
131131
.expect(400, done);
132132
});
133+
134+
it('should not set/change prototype', function (done) {
135+
createServer();
136+
request(app)
137+
.post('/')
138+
.set('Content-Type', 'application/xml')
139+
.send('<__proto__><name>Bob</name></__proto__>')
140+
.expect(200, { parsed: { name: ['Bob'] } }, done);
141+
});
133142
});

0 commit comments

Comments
 (0)