VYPR
High severity7.5NVD Advisory· Published Feb 5, 2025· Updated Apr 15, 2026

CVE-2024-57085

CVE-2024-57085

Description

A prototype pollution in the function deepMerge of @stryker-mutator/util v8.6.0 allows attackers to cause a Denial of Service (DoS) via supplying a crafted payload.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
@stryker-mutator/utilnpm
< 8.7.18.7.1

Patches

1
f7b34bfbbde3

fix(util): prevent prototype pollution in deepMerge (#5144)

https://github.com/stryker-mutator/stryker-jsNico JansenDec 11, 2024via ghsa
2 files changed · +25 10
  • packages/util/src/deep-merge.ts+12 10 modified
    @@ -8,15 +8,17 @@ export type DeepPartial<T> = {
      * @param overrides
      */
     export function deepMerge<T>(defaults: T, overrides: DeepPartial<T>): void {
    -  Object.keys(overrides).forEach((key) => {
    -    const defaultValue = (defaults as any)[key];
    -    const overrideValue = (overrides as any)[key];
    -    if (overrideValue !== undefined) {
    -      if (defaultValue === undefined || typeof defaultValue !== 'object' || typeof overrideValue !== 'object' || Array.isArray(defaultValue)) {
    -        (defaults as any)[key] = overrideValue;
    -      } else {
    -        deepMerge(defaultValue, overrideValue as DeepPartial<T>);
    +  Object.keys(overrides)
    +    .filter((key) => key !== '__proto__')
    +    .forEach((key) => {
    +      const defaultValue = (defaults as any)[key];
    +      const overrideValue = (overrides as any)[key];
    +      if (overrideValue !== undefined) {
    +        if (defaultValue === undefined || typeof defaultValue !== 'object' || typeof overrideValue !== 'object' || Array.isArray(defaultValue)) {
    +          (defaults as any)[key] = overrideValue;
    +        } else {
    +          deepMerge(defaultValue, overrideValue as DeepPartial<T>);
    +        }
           }
    -    }
    -  });
    +    });
     }
    
  • packages/util/test/unit/deep-merge.spec.ts+13 0 modified
    @@ -60,4 +60,17 @@ describe(deepMerge.name, () => {
         const expected: Foo = { foo: '1' };
         expect(foo).deep.eq(expected);
       });
    +
    +  it('should prevent prototype pollution', () => {
    +    // Arrange
    +    const someObj = {};
    +
    +    // Act
    +    // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
    +    deepMerge(someObj, JSON.parse('{"__proto__":{"pollutedKey":123}}'));
    +
    +    // Assert
    +    // @ts-expect-error This polluted key shouldn't be there, that's the point
    +    expect({}.__proto__.pollutedKey).undefined;
    +  });
     });
    

Vulnerability mechanics

Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

6

News mentions

0

No linked articles in our index yet.