[GHSA-7mg4-w3w5-x5pc] Prototype pollution in json-pointer#7453
Open
Wenxin-Jiang wants to merge 1 commit intoWenxin-Jiang/advisory-improvement-7453from
Open
[GHSA-7mg4-w3w5-x5pc] Prototype pollution in json-pointer#7453Wenxin-Jiang wants to merge 1 commit intoWenxin-Jiang/advisory-improvement-7453from
Wenxin-Jiang wants to merge 1 commit intoWenxin-Jiang/advisory-improvement-7453from
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
The prototype-pollution sink requires
api.set()to traverse into an inherited property like__proto__orconstructor.prototype.In
0.0.2–0.2.2, the traversal is gated by!obj.hasOwnProperty(tok), which is false for inherited names. The code therefore enters the create branch and executesobj['__proto__'] = {}, replacing the local object's prototype with a fresh{}instead of navigating intoObject.prototype.Global pollution is not reachable through any of the three standard vectors:
__proto__constructor.prototypeprototypeThe exploitable shape first appears in
0.3.0, when the guard was rewritten to!(tok in obj), which treats inherited properties as present and thus navigates into them.Fix commit
1dbd1ed(PR#34) is written against that0.3.0+shape.