Skip to content

Commit

Permalink
BAP-21092: JavaScript Prototype Pollution (#31464)
Browse files Browse the repository at this point in the history
  • Loading branch information
Grygir authored Dec 24, 2021
1 parent d9929d4 commit 62c2693
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Oro/Bundle/UIBundle/Resources/public/js/tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ define(function(require) {
query = query.slice(1);
}
const setValue = function(root, path, value) {
if (path[0] === '__proto__') {
// Prevent Object.prototype pollution
return;
}
if (path.length > 1) {
const dir = path.shift();
if (typeof root[dir] === 'undefined') {
Expand Down

0 comments on commit 62c2693

Please # to comment.