Skip to content

Commit 51f539d

Browse files
committed
1 parent 92239d6 commit 51f539d

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

src/ReportGenerator.Core/Reporting/Builders/Rendering/resources/chartist.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,16 @@ var Chartist = {
8181
* @return {Object} An object that has the same reference as target but is extended and merged with the properties of source
8282
*/
8383
Chartist.extend = function (target) {
84-
var i, source, sourceProp;
84+
var i, source, sourceProp, targetProto;
8585
target = target || {};
8686

8787
for (i = 1; i < arguments.length; i++) {
88-
source = arguments[i];
88+
source = arguments[i];
89+
targetProto = Object.getPrototypeOf(target);
8990
for (var prop in source) {
91+
if (targetProto !== null && prop in targetProto) {
92+
continue; // prevent prototype pollution
93+
}
9094
sourceProp = source[prop];
9195
if (typeof sourceProp === 'object' && sourceProp !== null && !(sourceProp instanceof Array)) {
9296
target[prop] = Chartist.extend(target[prop], sourceProp);

0 commit comments

Comments
 (0)