dottie is vulnerable to Prototype Pollution bypass via non-first path segments in set() and transform()
CVE-2026-27837 · GHSA-r5mx-6wc6-7h9w
- Affected
- npm dottie >= 2.0.4, <= 2.0.6
- Fixed in
- 2.0.7· Vendor fix available
- Issue
- 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…
Recommended action: Upgrade to 2.0.7 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.