Severity:

HIGH RISK

(7.3)

Prototype Pollution in 1024bit extend-deep

CVE-2026-6621

Deferred

Vulnerability type

Category:

Prototype Pollution

CWE:

CWE-94, CWE-1321

Impact:

Potential Remote Code Execution via Prototype Pollution

Severity:

HIGH RISK

(7.3)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A prototype pollution vulnerability in the 1024bit extend-deep library up to version 0.1.6 allows attackers to modify JavaScript object prototypes via the __proto__ argument.

In certain application contexts, this can be escalated to arbitrary code execution when polluted objects are later used by dynamic code paths or trusted framework logic.

Affected context

This issue affects Node.js or browser-based applications that:

  • Include the extend-deep library up to version 0.1.6
  • Allow attacker-influenced input to be merged or extended into objects using this library
  • Rely on plain JavaScript objects for configuration, request data, or internal state
  • Use polluted properties in sensitive code paths (e.g., dynamic function construction, template rendering, or security checks)

Risk materializes when untrusted input can introduce __proto__ keys that are not filtered before deep merge operations.

Exploit preconditions

  • Attack surface: Application features that accept structured input (e.g., JSON bodies, query parameters, form data, or WebSocket messages) which are passed to extend-deep.
  • Required access: Remote attacker with the ability to supply or influence data merged by extend-deep into target objects.
  • Trigger point: A call to the vulnerable function in index.js that performs deep extension/merge and honors the __proto__ property of user-controlled input.
  • Why exploitation is possible: The implementation does not block or sanitize special prototype-bearing properties (such as __proto__, constructor, or prototype), allowing modification of Object.prototype or other prototypes and impacting all derived objects.

Why this happens

The underlying bug belongs to the prototype pollution class described by CWE-1321.

The library's deep-merge logic naively copies all enumerable properties, including special ones like __proto__, from source objects to target objects.

In JavaScript, assigning to __proto__ of an object can change its internal prototype reference, effectively modifying inherited properties for many objects at once.

When this polluted state is later consumed by code that constructs functions dynamically, evaluates expressions, or interacts with other security-sensitive subsystems, the behavior maps to CWE-94: Improper Control of Generation of Code, as attacker-controlled data can influence runtime code semantics.

Potential impact

  • Global modification of Object.prototype or other core prototypes, affecting wide portions of the application.
  • Bypassing of security checks that rely on object property presence, types, or default values.
  • Escalation to arbitrary code execution in environments where polluted properties are passed into dynamic code creation, templating engines, or command execution wrappers.
  • Data integrity issues, including tampering with configuration objects, feature flags, or access-control decisions.
  • Application instability, unexpected exceptions, or denial of service caused by corrupted prototypes.

General mitigation guidance

Effective mitigation focuses on eliminating prototype pollution sources and reducing trust in merged input:

  • Prefer libraries or merge utilities that explicitly block __proto__, constructor, prototype, and other magic properties by default.
  • Introduce strict validation and normalization of incoming structured data before it is merged, converting only whitelisted keys and types.
  • Use object creation patterns that do not rely on Object.prototype defaults (e.g., Object.create(null) for dictionaries) where feasible.
  • Separate untrusted data from internal configuration or security-critical objects; avoid deep-merging user-supplied input into global or shared objects.
  • Apply least-privilege design to code execution features so that dynamic evaluation is not performed on values derived from object properties that could be polluted.

These patterns help contain the effect of potentially polluted attributes even if vulnerable merge behavior exists.

How teams detect issues like this

Detection typically combines code-level and behavior-level analysis:

  • Static analysis: Search for usages of extend-deep or similar deep merge utilities, especially where arguments can be influenced by request data or external input. Flag merges into global objects, configuration structures, or framework-level state.
  • Code review signals: Calls that merge request bodies, query parameters, or decoded JSON directly into options, settings, or model objects without explicit key whitelisting or prototype sanitization.
  • Policy enforcement: CI rules that disallow libraries with known prototype pollution patterns, or require explicit vetting for any deep merge or extend helpers.
  • Runtime monitoring: Instrumentation or application security tooling that detects unexpected additions to Object.prototype or other core prototypes, or monitors for anomalous new properties appearing on many objects simultaneously.

Automated SCA and static analysis tools can be configured to recognize prototype pollution sources and block risky patterns during development.

Sources

SourceLink
github.comgithub.com/sudo-secure/security-research/blob/main/extend-deep/prototype-pollution/PoC.md
vuldb.comvuldb.com/submit/792387
vuldb.comvuldb.com/vuln/358256
vuldb.comvuldb.com/vuln/358256/cti

Frequently asked

questions

Not always. Prototype pollution is universally possible when untrusted input reaches the vulnerable merge function, but whether it leads to remote code execution depends on how polluted properties are later used. In some applications the impact may be limited to logic tampering or denial of service.

The attacker needs any capability to send data that is eventually passed into extend-deep, such as HTTP request bodies, query parameters, or messages. No local system access is required if the application directly exposes such functionality over the network.

Replace or wrap the vulnerable merge functionality with an implementation that blocks prototype-related keys and operates on a well-defined schema. Additionally, separate untrusted data from internal configuration objects and avoid deep merging unvalidated input.

Adopt secure-by-default merge utilities, enforce input validation and key whitelisting, avoid relying on global prototypes for application logic, and integrate static analysis or code review checklists that specifically look for prototype pollution patterns before code is merged.

Find out what's already
exploitable in your codebase.