fix: validate literal JSON property names consistently - #131
Open
fitchmultz wants to merge 5 commits into
Open
fitchmultz wants to merge 5 commits into
fitchmultz wants to merge 5 commits into
Conversation
Author
|
Local verification is complete for 81d9359: 1,067 unit tests and 7,513 spec tests pass, plus the native build and CJS/ESM smoke checks. The upstream CI run is currently |
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.
Summary
Preserve literal JSON member names in validation, schema traversal, and references. On 11.6.2, ordinary undeclared
__proto__,constructor, andtoStringmembers can throw or bypass validation; a declared__proto__can disappear from compiled dictionaries. Unescaped schema keys can also resolve to a different location.$defsanddefinitionsseparate when both are authored, including overlapping names. Retain the existing single-dictionary alias when only one spelling is present, without duplicate visits.uri-jsnormalizer; document identifiers and reserved anchor characters retain their distinctions.settings.propertyBlacklistto[], removing the implicit_idadditional-property exemption. Callers can explicitly configure["_id"]to retain that legacy behavior.No input keys are prohibited or removed. Declared special names remain ordinary data. Reference handling stays in the library's native URI/reference owners; no alternate resolver or parser aliases are introduced. This is a member-name correctness correction, with no exploit claim.
Verification
Based on main
65578c185fc324ebf8fcc8f6e654e85cbfab4da8.$reference regression in an intermediate candidate. Before the correction, eight draft/keyword combinations failed; final source and built-runtime controls enforce positive, wrong-type, and wrong-value expectations. Parent rerun passes all 30 alias records and 14 preservation controls, including both merge orders and distinct document/anchor spellings.The shared URI normalizer composes with #133's separate reference-scope and anonymous-root identity corrections; this PR preserves the existing empty-root branching behavior. Named-anchor normalization follows RFC 3986 §§2.3 and 6.2.2.2. Pointer fragments follow RFC 6901 §6: separators are decoded before token selection. Only fragments are normalized; literal percent sequences are decoded once and document paths remain unchanged.