CVE-2019-10747
Description
set-value is vulnerable to Prototype Pollution in versions lower than 3.0.1. The function mixin-deep could be tricked into adding or modifying properties of Object.prototype using any of the constructor, prototype and _proto_ payloads.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Prototype Pollution in set-value allows attackers to add or modify Object.prototype properties via constructor, prototype, or __proto__ payloads.
Vulnerability
set-value versions before 3.0.1 are vulnerable to Prototype Pollution. The mixin-deep function can be tricked into adding or modifying properties of Object.prototype using any of the constructor, prototype, or __proto__ payloads [1][2]. This occurs because the library does not properly sanitize object keys that reference these special properties.
Exploitation
An attacker can exploit this by passing crafted object paths that traverse to __proto__ or constructor.prototype when calling set-value. No authentication is required; the attack is performed by providing malicious input to the set function. Applications that accept user-controlled object paths from sources such as API parameters, configuration files, or query strings are particularly at risk [3].
Impact
Successful exploitation allows an attacker to pollute Object.prototype, which can lead to unexpected behavior across the application, such as overriding default properties or bypassing security checks. In some environments, this can be leveraged for remote code execution or denial of service [3].
Mitigation
The fix was released in version 3.0.1. Users should update to at least 3.0.1, which disallows setting properties on __proto__, prototype, and constructor keys [1][2]. No workaround other than upgrading exists.
AI Insight generated on May 22, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
set-valuenpm | < 2.0.1 | 2.0.1 |
set-valuenpm | >= 3.0.0, < 3.0.1 | 3.0.1 |
Affected products
4- set-value/set-valuedescription
- ghsa-coords3 versions
< 2.0.1+ 2 more
- (no CPE)range: < 2.0.1
- (no CPE)range: < 2.0.3-1.module_el8.4.0+2521+c668cc9f
- (no CPE)range: < 17-3.module_el8.4.0+2224+b07ac28e
Patches
2cb12f14955ddensure only valid keys are used
1 file changed · +5 −1
index.js+5 −1 modified@@ -25,7 +25,7 @@ module.exports = function(obj, prop, val) { return obj; } - var keys = split(prop, {sep: '.', brackets: true}); + var keys = split(prop, {sep: '.', brackets: true}).filter(isValidKey); var len = keys.length; var idx = -1; var current = obj; @@ -49,3 +49,7 @@ module.exports = function(obj, prop, val) { return obj; }; + +function isValidKey(key) { + return key !== '__proto__' && key !== 'constructor' && key !== 'prototype'; +}
95e9d9923f8adisallow proto keys
6 files changed · +39 −28
index.js+6 −10 modified@@ -25,7 +25,7 @@ function set(target, path, value, options) { merge = Object.assign; } - const keys = isArray ? path : split(path, opts); + const keys = (isArray ? path : split(path, opts)).filter(isValidKey); const len = keys.length; const orig = target; @@ -98,16 +98,12 @@ function createKey(pattern, options) { return id; } +function isValidKey(key) { + return key !== '__proto__' && key !== 'constructor' && key !== 'prototype'; +} + function isObject(val) { - switch (typeof val) { - case 'object': - return val !== null; - case 'function': - return true; - default: { - return false; - } - } + return val !== null && (typeof val === 'object' || typeof val === 'function'); } set.memo = {};
LICENSE+1 −1 modified@@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2014-2018, Jon Schlinkert. +Copyright (c) 2014-present, Jon Schlinkert. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal
package.json+5 −3 modified@@ -36,7 +36,7 @@ "dot-prop": "^4.2.0", "dot2val": "^1.2.2", "es5-dot-prop": "^4.1.1", - "gulp-format-md": "^1.0.0", + "gulp-format-md": "^2.0.0", "lodash.set": "^4.3.2", "minimist": "^1.2.0", "mocha": "^3.5.3", @@ -124,7 +124,9 @@ "set-deep", "set-deep-prop", "set-nested-prop", - "setvalue" + "setvalue", + "split-string", + "update" ] } -} +} \ No newline at end of file
README.md+16 −11 modified@@ -1,4 +1,4 @@ -# set-value [](https://www.npmjs.com/package/set-value) [](https://npmjs.org/package/set-value) [](https://npmjs.org/package/set-value) [](https://travis-ci.org/jonschlinkert/set-value) +# set-value [](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=W8YFZ425KND68) [](https://www.npmjs.com/package/set-value) [](https://npmjs.org/package/set-value) [](https://npmjs.org/package/set-value) [](https://travis-ci.org/jonschlinkert/set-value) > Create nested values and any intermediaries using dot notation (`'a.b.c'`) paths. @@ -12,10 +12,14 @@ Install with [npm](https://www.npmjs.com/): $ npm install --save set-value ``` +## Heads up! + +[Please update](https://github.com/update/update) to version 3.0.1 or later, a critical bug was fixed in that version. + ## Usage ```js -var set = require('set-value'); +const set = require('set-value'); set(object, prop, value); ``` @@ -30,7 +34,7 @@ set(object, prop, value); Updates and returns the given object: ```js -var obj = {}; +const obj = {}; set(obj, 'a.b.c', 'd'); console.log(obj); //=> { a: { b: { c: 'd' } } } @@ -210,25 +214,26 @@ You might also be interested in these projects: ### Contributors -| **Commits** | **Contributor** | -| --- | --- | -| 64 | [jonschlinkert](https://github.com/jonschlinkert) | -| 1 | [vadimdemedes](https://github.com/vadimdemedes) | -| 1 | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) | +| **Commits** | **Contributor** | +| --- | --- | +| 71 | [jonschlinkert](https://github.com/jonschlinkert) | +| 2 | [mbelsky](https://github.com/mbelsky) | +| 1 | [vadimdemedes](https://github.com/vadimdemedes) | +| 1 | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) | ### Author **Jon Schlinkert** -* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) * [GitHub Profile](https://github.com/jonschlinkert) * [Twitter Profile](https://twitter.com/jonschlinkert) +* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) ### License -Copyright © 2018, [Jon Schlinkert](https://github.com/jonschlinkert). +Copyright © 2019, [Jon Schlinkert](https://github.com/jonschlinkert). Released under the [MIT License](LICENSE). *** -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on March 05, 2018._ \ No newline at end of file +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on June 19, 2019._ \ No newline at end of file
.travis.yml+4 −0 modified@@ -2,9 +2,13 @@ sudo: false os: - linux - osx + - windows language: node_js node_js: - node + - '12' + - '11' + - '10' - '9' - '8' - '7'
.verb.md+7 −3 modified@@ -1,7 +1,11 @@ +## Heads up! + +[Please update][update] to version 3.0.1 or later, a critical bug was fixed in that version. + ## Usage ```js -var set = require('{%= name %}'); +const set = require('{%= name %}'); set(object, prop, value); ``` @@ -17,7 +21,7 @@ set(object, prop, value); Updates and returns the given object: ```js -var obj = {}; +const obj = {}; set(obj, 'a.b.c', 'd'); console.log(obj); //=> { a: { b: { c: 'd' } } } @@ -104,4 +108,4 @@ These are just a few of the duplicate libraries on NPM. - Adds support for escaping with double or single quotes. See [escaping](#escaping) for examples. - Will no longer split inside brackets or braces. See [bracket support](#bracket-support) for examples. -If there are any regressions please create a [bug report](../../issues/new). Thanks! +If there are any regressions please create a [bug report](../../issues/new). Thanks! \ No newline at end of file
Vulnerability mechanics
Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
12- github.com/advisories/GHSA-4g88-fppr-53ppghsaADVISORY
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/3EJ36KV6MXQPUYTFCCTDY54E5Y7QP3AV/mitrevendor-advisoryx_refsource_FEDORA
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/E3HNLQZQINMZK6GYB2UTKK4VU7WBV2OT/mitrevendor-advisoryx_refsource_FEDORA
- nvd.nist.gov/vuln/detail/CVE-2019-10747ghsaADVISORY
- github.com/jonschlinkert/set-value/commit/95e9d9923f8a8b4a01da1ea138fcc39ec7b6b15fghsaWEB
- github.com/jonschlinkert/set-value/commit/cb12f14955dde6e61829d70d1851bfea6a3c31adghsaWEB
- lists.apache.org/thread.html/b46f35559c4a97cf74d2dd7fe5a48f8abf2ff37f879083920af9b292%40%3Cdev.drat.apache.org%3Emitremailing-listx_refsource_MLIST
- lists.apache.org/thread.html/b46f35559c4a97cf74d2dd7fe5a48f8abf2ff37f879083920af9b292@%3Cdev.drat.apache.org%3EghsaWEB
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/3EJ36KV6MXQPUYTFCCTDY54E5Y7QP3AVghsaWEB
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/E3HNLQZQINMZK6GYB2UTKK4VU7WBV2OTghsaWEB
- snyk.io/vuln/SNYK-JS-SETVALUE-450213ghsax_refsource_MISCWEB
- www.npmjs.com/advisories/1012ghsaWEB
News mentions
0No linked articles in our index yet.