Skip to content

Commit 9e569b7

Browse files
committed
Reset prototype of XML after parsing
1 parent f025695 commit 9e569b7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ module.exports = function (bodyParser) {
4343
return next(err);
4444
}
4545

46+
// Set the prototype of parsed xml object to null, so that prototype pollution is prevented.
47+
xml.__proto__ = undefined;
4648
req.body = xml || req.body;
4749
next();
4850
});

0 commit comments

Comments
 (0)