Prototype Pollution Vulnerability in dset

dset Updated 02 Oct 2025

Summary

24/05/2022
Yes i
Critical
9.8

CVE-2020-28277: dset vulnerable to prototype pollution. Affects dset versions >= 1.0.0, < 2.0.1. Fixed in 2.0.1. 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

dset is an npm package that provides a utility function for setting nested properties in JavaScript objects. It allows developers to easily manipulate and modify object properties. However, versions 1.0.0 through 2.0.1 of dset are vulnerable to a prototype pollution attack.

Vulnerability Detail

The vulnerability in dset arises from a lack of validation in the 'export()' function. This function does not check the type of object before assigning a value to a property. As a result, an attacker can exploit this flaw to create a non-existent property or manipulate existing properties, leading to denial of service or potential remote code execution. By supplying a malicious value through the 'keys' argument, an attacker can pollute the object prototype and potentially bypass security checks.

How To Fix

Minimum fixed version

2.0.1

This is the first release that contains the fix.

npm install dset@2.0.1

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

Workaround

If updating to a fixed version of dset is not immediately possible, a workaround can be implemented by manually validating the 'keys' argument before calling the 'export()' function. This can be done by checking if the 'keys' value includes any potentially dangerous properties, such as 'proto'. If such properties are detected, the function should reject the input and prevent the pollution of the object prototype. Here is an example of a workaround implementation:

const dset = require('dset');

function safeExport(obj, keys, val) {
  if (keys.includes('__proto__')) {
    throw new Error('Invalid keys');
  }
  dset(obj, keys, val);
}

var obj = {};
console.log('Before:', obj.isAdmin);
safeExport(obj, '__proto__.polluted', true);
console.log('After:', obj.polluted);

Conclusion

The prototype pollution vulnerability in dset versions 1.0.0 through 2.0.1 can have serious consequences, including denial of service and potential remote code execution. It is crucial to update to a fixed version of dset (2.0.2 or later) as soon as possible. If immediate updating is not feasible, implementing the provided workaround can help mitigate the risk. For further assistance and support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for dset →

Share this vulnerability

FAQ

dset is an npm package that provides a utility function for setting nested properties in JavaScript objects.

Versions 1.0.0 through 2.0.1 of dset are vulnerable to this prototype pollution attack.

Prototype pollution is a vulnerability that allows an attacker to modify the prototype of an object, potentially leading to unexpected behavior or security issues.

The vulnerability in dset can lead to denial of service or remote code execution, depending on how it is exploited.

To fix this vulnerability, update your package.json file to use a version of dset that is equal to or greater than 2.0.2 and run 'npm install' to install the updated package.

Related vulnerabilities

Recent vulnerabilities recorded for dset.

How To Fix

Minimum fixed version

2.0.1

This is the first release that contains the fix.

npm install dset@2.0.1

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