CVE-2021-23440: Prototype Pollution in set-value

set-value Updated 02 Oct 2025

Summary

13/09/2021
Yes i
High
7.3

CVE-2021-23440: Prototype Pollution in set-value. Affects set-value across 3 version ranges.

< 2.0.1 >= 3.0.0, < 3.0.3 >= 4.0.0, < 4.0.1

Fixed in 2.0.1, 3.0.3 or 4.0.1, depending on the release line you run. How to fix ↓

Also tracked for

The same CVE-2021-23440 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

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 Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

The package 'set-value' is an npm package that provides a utility function for setting nested properties in JavaScript objects. It is commonly used in web applications and other JavaScript projects. The vulnerability identified as CVE-2021-23440 is a type confusion vulnerability that affects the 'set-value' package. It can lead to a bypass of CVE-2019-10747 when user-provided keys used in the path parameter are arrays.

Vulnerability Detail

The vulnerability arises due to a type confusion issue in the 'set-value' package. When user-provided keys used in the path parameter are arrays, it can result in prototype pollution. This can potentially lead to unauthorized modifications of objects and properties, allowing an attacker to execute arbitrary code or perform other malicious activities. The impact of this vulnerability is considered high, with a CVSS score of 7.3.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • < 2.0.1 2.0.1
    npm install set-value@2.0.1
  • >= 3.0.0, < 3.0.3 3.0.3
    npm install set-value@3.0.3
  • >= 4.0.0, < 4.0.1 4.0.1
    npm install set-value@4.0.1

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

There is no specific workaround mentioned for this vulnerability. However, developers can mitigate the risk by avoiding the use of user-provided keys as arrays in the path parameter when using the 'set-value' package.

Conclusion

The 'set-value' package is vulnerable to a type confusion issue that can lead to prototype pollution. It is recommended to update the package to version 4.0.1 or later to fix this vulnerability. Developers should also avoid using user-provided keys as arrays in the path parameter to mitigate the risk. For further support on vulnerability remediation, you can contact DevNack.com.

See every vulnerability recorded for set-value →

Share this vulnerability

FAQ

The vulnerability can lead to unauthorized modifications of objects and properties, potentially allowing an attacker to execute arbitrary code or perform other malicious activities.

To fix this vulnerability, update the 'set-value' package to version 4.0.1 or later.

There is no specific workaround mentioned for this vulnerability. However, developers can mitigate the risk by avoiding the use of user-provided keys as arrays in the path parameter when using the 'set-value' package.

The CVSS score of this vulnerability is 7.3.

For more information about this vulnerability, you can refer to the GitHub Advisory Database: [link to the vulnerability details]

Related vulnerabilities

Recent vulnerabilities recorded for set-value.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • < 2.0.1 2.0.1
    npm install set-value@2.0.1
  • >= 3.0.0, < 3.0.3 3.0.3
    npm install set-value@3.0.3
  • >= 4.0.0, < 4.0.1 4.0.1
    npm install set-value@4.0.1

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. 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