Monitor vulnerabilities like this one.
Sign up free to get alerted when software you use is affected.
6.3
Dottie Library Allows Malicious Code Injection via Prototype Pollution
GHSA-r5mx-6wc6-7h9w
CVE-2026-27837
Summary
A vulnerability in Dottie versions 2.0.4 to 2.0.6 allows attackers to inject malicious code into a specific object's prototype chain, making it difficult to detect and potentially leading to authorization bypass. This can happen when using the set() or transform() functions. To protect your application, update to a fixed version of Dottie.
What to do
- Update mickhansen dottie to version 2.0.7.
Affected software
| Vendor | Product | Affected versions | Fix available |
|---|---|---|---|
| mickhansen | dottie | > 2.0.4 , <= 2.0.6 | 2.0.7 |
| dottie_project | dottie | > 2.0.4 , <= 2.0.7 | – |
Original title
dottie is vulnerable to Prototype Pollution bypass via non-first path segments in set() and transform()
Original description
### Summary
dottie versions 2.0.4 through 2.0.6 contain an incomplete fix for CVE-2023-26132. The prototype pollution guard introduced in commit `7d3aee1` only validates the first segment of a dot-separated path, allowing an attacker to bypass the protection by placing `__proto__` at any position other than the first.
Both `dottie.set()` and `dottie.transform()` are affected.
### Details
The existing guard checks only `pieces[0] === '__proto__'`. When a path like `'a.__proto__.polluted'` is used, `pieces[0]` evaluates to `'a'`, not `'__proto__'`, so the guard is bypassed.
Inside the traversal loop, `current['__proto__'] = {}` triggers the `__proto__` setter, replacing the intermediate object's prototype. The final value is then written onto this new prototype.
**Important distinction:** This vulnerability does NOT pollute the global `Object.prototype`. It injects properties into a specific object's prototype chain. However, injected properties are invisible to `hasOwnProperty()` and `Object.keys()`, which makes them difficult to detect and can lead to authorization bypass in common coding patterns.
### PoC
```javascript
const dottie = require('dottie');
// set() bypass
const obj = {};
dottie.set(obj, 'session.__proto__.isAdmin', true);
console.log(obj.session.isAdmin); // true
console.log(({}).isAdmin); // undefined
console.log(obj.session.hasOwnProperty('isAdmin')); // false
// transform() bypass
const flat = { 'user.__proto__.role': 'admin', 'user.name': 'guest' };
const result = dottie.transform(flat);
console.log(result.user.role); // 'admin'
console.log(({}).role); // undefined
```
Tested on Node.js v20 and v22, dottie 2.0.6, Windows 11.
### Impact
The primary risk is authorization bypass. In a typical server-side scenario where dottie is used to process user input (e.g., via Sequelize, which depends on dottie with ~1.3M weekly npm downloads), an attacker can inject properties like `isAdmin: true` into objects used for access control decisions. Since the injected property is not an own property, standard checks using `hasOwnProperty()` or `Object.keys()` will not reveal it, while property access like `if (session.isAdmin)` will return `true`.
Additionally, replacing an object's prototype via `current['__proto__'] = {}` strips all inherited methods, potentially causing TypeError exceptions and denial of service.
dottie versions 2.0.4 through 2.0.6 contain an incomplete fix for CVE-2023-26132. The prototype pollution guard introduced in commit `7d3aee1` only validates the first segment of a dot-separated path, allowing an attacker to bypass the protection by placing `__proto__` at any position other than the first.
Both `dottie.set()` and `dottie.transform()` are affected.
### Details
The existing guard checks only `pieces[0] === '__proto__'`. When a path like `'a.__proto__.polluted'` is used, `pieces[0]` evaluates to `'a'`, not `'__proto__'`, so the guard is bypassed.
Inside the traversal loop, `current['__proto__'] = {}` triggers the `__proto__` setter, replacing the intermediate object's prototype. The final value is then written onto this new prototype.
**Important distinction:** This vulnerability does NOT pollute the global `Object.prototype`. It injects properties into a specific object's prototype chain. However, injected properties are invisible to `hasOwnProperty()` and `Object.keys()`, which makes them difficult to detect and can lead to authorization bypass in common coding patterns.
### PoC
```javascript
const dottie = require('dottie');
// set() bypass
const obj = {};
dottie.set(obj, 'session.__proto__.isAdmin', true);
console.log(obj.session.isAdmin); // true
console.log(({}).isAdmin); // undefined
console.log(obj.session.hasOwnProperty('isAdmin')); // false
// transform() bypass
const flat = { 'user.__proto__.role': 'admin', 'user.name': 'guest' };
const result = dottie.transform(flat);
console.log(result.user.role); // 'admin'
console.log(({}).role); // undefined
```
Tested on Node.js v20 and v22, dottie 2.0.6, Windows 11.
### Impact
The primary risk is authorization bypass. In a typical server-side scenario where dottie is used to process user input (e.g., via Sequelize, which depends on dottie with ~1.3M weekly npm downloads), an attacker can inject properties like `isAdmin: true` into objects used for access control decisions. Since the injected property is not an own property, standard checks using `hasOwnProperty()` or `Object.keys()` will not reveal it, while property access like `if (session.isAdmin)` will return `true`.
Additionally, replacing an object's prototype via `current['__proto__'] = {}` strips all inherited methods, potentially causing TypeError exceptions and denial of service.
ghsa CVSS3.1
6.3
Vulnerability type
CWE-1321
Prototype Pollution
- https://github.com/mickhansen/dottie.js/security/advisories/GHSA-r5mx-6wc6-7h9w
- https://nvd.nist.gov/vuln/detail/CVE-2026-27837
- https://github.com/mickhansen/dottie.js/commit/7e8fa1345a4b46325f0eab8d7aeb1c4de...
- https://github.com/advisories/GHSA-4gxf-g5gf-22h4
- https://github.com/advisories/GHSA-r5mx-6wc6-7h9w
Published: 26 Feb 2026 · Updated: 10 Mar 2026 · First seen: 6 Mar 2026