Critical Type Confusion Vulnerability in node-set-value Package

node-set-value Updated 02 Oct 2025

Summary

12/09/2021
N/A
Yes i
Critical
9.8

CVE-2021-23440: This affects the package set-value before =3.0.0. Affects node-set-value across 2 version ranges.

< 3.0.1-2+deb11u1 < 7cf8073bb06bf0c15e08475f9f952823b4576452

Fixed in 3.0.1-2+deb11u1. 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 MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

The node-set-value package is a utility for setting values in JavaScript objects, allowing developers to easily manipulate object properties. It is widely used in various applications for its simplicity and effectiveness. However, certain versions of this package are vulnerable to a type confusion issue that can lead to security breaches, particularly when user-provided keys are used improperly.

Vulnerability Detail

This vulnerability, identified as CVE-2021-23440, affects the node-set-value package versions before 2.0.1 and between 3.0.0 and 4.0.1. It arises from a type confusion flaw that can allow attackers to bypass the protections established by CVE-2019-10747. The issue occurs when user-provided keys in the path parameter are treated as arrays, potentially leading to unauthorized access or manipulation of data. The severity of this vulnerability is underscored by its CVSS score of 9.8, indicating a critical risk to applications utilizing affected versions of the package.

How To Fix

Minimum fixed version

3.0.1-2+deb11u1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade node-set-value

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If immediate upgrading is not feasible, consider implementing input validation to sanitize user-provided keys before they are processed by the node-set-value function. This can help mitigate the risk of type confusion. Example code:

function safeSetValue(obj, path, value) {
    if (Array.isArray(path)) {
        throw new Error('Invalid path: arrays are not allowed.');
    }
    setValue(obj, path, value);
}

Conclusion

The CVE-2021-23440 vulnerability in the node-set-value package poses a significant risk to applications that utilize affected versions. It is crucial to upgrade to a secure version to mitigate potential security threats. Additionally, implementing input validation can serve as a temporary measure to protect against this vulnerability.

See every vulnerability recorded for node-set-value →

Share this vulnerability

FAQ

CVE-2021-23440 is a critical vulnerability in the node-set-value package that allows for type confusion, potentially leading to unauthorized data access.

The vulnerability affects node-set-value versions before 2.0.1 and between 3.0.0 and 4.0.1.

You can use the Vulert platform to monitor and alert for open-source vulnerabilities in your software by analyzing your manifest file, such as package-lock.json.

The CVSS score for CVE-2021-23440 is 9.8, indicating a critical level of risk.

Implement input validation to sanitize user-provided keys as a temporary workaround until you can upgrade to a secure version.

Related vulnerabilities

Recent vulnerabilities recorded for node-set-value.

How To Fix

Minimum fixed version

3.0.1-2+deb11u1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade node-set-value

Tip — Not sure which version your app runs? Vulert can match this fix to it. 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