CVE-2021-40663: Prototype Pollution in deep.assign

deep.assign Updated 02 Oct 2025

Summary

01/07/2022
No i
Critical
9.8

CVE-2021-40663: Prototype Pollution in deep.assign. Affects deep.assign versions 0.0.0-alpha.0. No fix is published. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The deep.assign npm package is a utility library that provides a function for deep merging objects. It is commonly used in JavaScript applications to combine multiple objects into a single object, recursively merging nested properties. The vulnerable version of deep.assign is 0.0.0-alpha.0.

Vulnerability Detail

The deep.assign npm package version 0.0.0-alpha.0 is vulnerable to Prototype Pollution. This vulnerability occurs when user-controllable data is used to modify the prototype of an object, leading to unexpected behavior or security issues. In this case, the package does not properly control modifications to object prototype attributes, allowing an attacker to manipulate the prototype chain and potentially execute arbitrary code or modify existing objects in unintended ways. The severity of this vulnerability is rated as CRITICAL with a CVSS score of 9.8.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

As a temporary workaround, developers can manually validate and sanitize any user-controllable data before using it to modify object prototypes. This can involve checking the data for unexpected or malicious values and ensuring that only safe and trusted data is used in prototype modifications. Here is an example of how to sanitize user input in JavaScript:

function sanitizeInput(input) {
  // Perform input validation and sanitization
  // Return sanitized input
}

const userControllableData = getUserInput();
const sanitizedData = sanitizeInput(userControllableData);

Object.setPrototypeOf(targetObject, sanitizedData);

This code snippet demonstrates a basic approach to sanitize user input before using it to modify object prototypes.

Conclusion

The deep.assign npm package version 0.0.0-alpha.0 is vulnerable to Prototype Pollution. It is crucial to upgrade to a non-vulnerable version of the package to mitigate the risk of arbitrary code execution or unauthorized modifications to objects. Developers should follow the recommended steps to fix this vulnerability and ensure the security of their applications. For further support on vulnerability remediation, you can reach out to DevNack.com.

See every vulnerability recorded for deep.assign →

Share this vulnerability

FAQ

Prototype Pollution is a vulnerability that occurs when user-controllable data is used to modify the prototype of an object, leading to unexpected behavior or security issues. It can allow an attacker to manipulate the prototype chain and potentially execute arbitrary code or modify existing objects in unintended ways.

The impact of this vulnerability can vary depending on how the deep.assign package is used in an application. In worst-case scenarios, an attacker could execute arbitrary code or modify critical objects, leading to remote code execution, data breaches, or other security compromises.

Yes, it is recommended to upgrade to a non-vulnerable version of the deep.assign package. The maintainers of the package have likely released a patch or a newer version that addresses this issue. Developers should update their package.json file to use the latest version of deep.assign and run the package manager's update command to fetch and install the updated package.

As a temporary workaround, developers can manually validate and sanitize any user-controllable data before using it to modify object prototypes. This can involve checking the data for unexpected or malicious values and ensuring that only safe and trusted data is used in prototype modifications.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback