diff --git a/x-pack/plugins/timelines/server/search_strategy/timeline/factory/helpers/format_timeline_data.ts b/x-pack/plugins/timelines/server/search_strategy/timeline/factory/helpers/format_timeline_data.ts index 481b74a802fec..3b83bb0873981 100644 --- a/x-pack/plugins/timelines/server/search_strategy/timeline/factory/helpers/format_timeline_data.ts +++ b/x-pack/plugins/timelines/server/search_strategy/timeline/factory/helpers/format_timeline_data.ts @@ -34,7 +34,14 @@ const createBaseTimelineEdges = (): TimelineEdges => ({ function deepMerge(target: EventSource, source: EventSource) { for (const key in source) { - if (source && source[key] instanceof Object && target && target[key] instanceof Object) { + if ( + !Object.prototype.hasOwnProperty.call(source, key) || + key === '__proto__' || + key === 'constructor' + ) + // eslint-disable-next-line no-continue + continue; + if (source[key] instanceof Object && target[key] instanceof Object) { deepMerge(target[key], source[key]); } else { target[key] = source[key];