Skip to content

Commit

Permalink
[FIX] Add guard against prototype pollution (#960)
Browse files Browse the repository at this point in the history
  • Loading branch information
d3xter666 authored Nov 24, 2023
1 parent 50bb0d9 commit ba230d9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/processors/jsdoc/lib/ui5/template/publish.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ function merge(target, source) {
if ( source != null ) {
// simple single source merge
Object.keys(source).forEach((prop) => {
// guarding against prototype pollution. (https://codeql.github.com/codeql-query-help/javascript/js-prototype-pollution-utility/#example)
if (prop === "__proto__" || prop === "constructor") {
return;
}
const value = source[prop];
if ( value != null && value.constructor === Object ) {
merge(target[prop] || {}, value);
Expand Down

0 comments on commit ba230d9

Please sign in to comment.