VYPR
Moderate severityNVD Advisory· Published Jul 25, 2022· Updated Sep 16, 2024

Prototype Pollution

CVE-2021-23397

Description

The @ianwalter/merge npm package is vulnerable to Prototype Pollution through its main merge function, allowing attackers to inject properties into Object.prototype.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

The @ianwalter/merge npm package is vulnerable to Prototype Pollution through its main merge function, allowing attackers to inject properties into Object.prototype.

Vulnerability

The @ianwalter/merge npm package (all versions) is vulnerable to Prototype Pollution via its main merge function [1]. The flaw stems from an unsafe recursive merge of source objects into a target object without proper sanitization of special keys like __proto__, constructor, or prototype. When the source object contains a property named __proto__, the merge function recurses onto the prototype of Object itself, polluting the global Object prototype [2].

Exploitation

An attacker can trigger the vulnerability by passing a crafted source object containing a malicious __proto__ property to the merge function. No authentication is required, as any application that merges untrusted user-controlled data using this library is susceptible. The attack surface depends on how the application processes user input; for example, merging JSON payloads from HTTP requests or deserializing data can provide an entry point [1][2].

Impact

Successful exploitation leads to polluting the base Object prototype, causing all JavaScript objects in the runtime to inherit the injected properties. This can result in denial of service (via exceptions) or, more critically, can alter application logic and enable cross-site scripting or remote code execution depending on how the polluted properties are used in the application [2].

Mitigation

No official fix is available for the @ianwalter/merge package. The maintainer recommends migrating to the @generates/merger package as a replacement [1]. Users should audit their dependencies and avoid merging untrusted data with vulnerable implementations.

AI Insight generated on May 21, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
@ianwalter/mergenpm
<= 9.0.1

Affected products

2

Patches

0

No patches discovered yet.

Vulnerability mechanics

AI mechanics synthesis has not run for this CVE yet.

References

3

News mentions

0

No linked articles in our index yet.