[GHSA-ff7x-qrg7-qggm] dot-prop Prototype Pollution vulnerability#7461
Open
Wenxin-Jiang wants to merge 1 commit intoWenxin-Jiang/advisory-improvement-7461from
Open
[GHSA-ff7x-qrg7-qggm] dot-prop Prototype Pollution vulnerability#7461Wenxin-Jiang wants to merge 1 commit intoWenxin-Jiang/advisory-improvement-7461from
Wenxin-Jiang wants to merge 1 commit intoWenxin-Jiang/advisory-improvement-7461from
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updates
Comments
CVE-2020-8116 is a prototype-pollution vulnerability in
dot-prop, but it is only reachable in versions that actually expose a write primitive. The vulnerable behavior lives in the library’sset()function, which walks a dot-delimited path and assigns into the target object at the final segment. The fix shipped in4.2.1and5.1.1, wheregetPathSegments()was updated to reject__proto__,prototype, andconstructor. Becauseset()(along withget(),has(), anddelete()) consumesgetPathSegments(), that denylist blocks the traversal pattern required for prototype pollution.Versions
1.0.0and1.0.1are not exploitable because they do not provide any write API at all. In those releases, the package consists entirely of a recursive getter:There is no
set(), nodelete(), nogetPathSegments(), and no assignment sink anywhere in the exported API. Since the library exposes no mechanism to write into an object using attacker-controlled path segments, there is no way to reachObject.prototypepollution through the1.xline. Any proof of concept aimed at1.0.0or1.0.1fails for a structural reason: there is simply no writable surface to call.The first vulnerable release is
2.0.0, which introduced the split{ get, set }API and, with it, the write-during-traversal pattern that makes prototype pollution possible:With an input such as
__proto__.polluted, this code traverses through the inherited__proto__accessor intoObject.prototype, then performs the final assignment there. That is the exact prototype-pollution behavior later blocked by the denylist in4.2.1and5.1.1.Evidence
1.0.0,1.0.1,2.0.0,4.2.0,4.2.1,5.1.0,5.1.11.0.0and1.0.1each export only a recursivegetPropfunction and no write-capable API2.0.0is the first release to addmodule.exports.set, which contains the vulnerable assign-during-walk logic4.2.1and5.1.1add a denylist for__proto__,prototype, andconstructorinsidegetPathSegments(), confirming that this traversal logic is the intended fix site1.0.0and1.0.1is not a testing artifact; those versions are missing the required API surface entirelyConclusion
The affected range for CVE-2020-8116 should begin at
2.0.0, not1.0.0. Versions1.0.0and1.0.1are false positives because they do not contain the vulnerableset()implementation or any equivalent write sink.