Repository navigation
fix(solid): refuse JSON-LD values the parser reads on past as errors - #831
Merged
Merged
Conversation
The bound on the work a deck or release file in JSON-LD may take charged each value as much as a value in an exported file. Some values the parser reports as an error and then reads on past, such as an @id that is no string or an @included member that is no node object, take it far longer than a triple and make none, so a file of them within the bound could hold the tab long after its import had failed. A term defined as another term that aliases a keyword also named that keyword unseen by the checks, so the values under it were counted as plain literals. refuseRemoteContexts now refuses such values up front, under an alias too: a non-string @id or a second one in an object, a @type that is no string or array of strings, an @index that is no string, a @reverse that is no object or holds a keyword, an @included member that is no node object, a @nest member that is no object or holds @value or @id, and a @list beside any key but @index. The members of a @set object, or of an array in it, count as the members of the keyword it sits under, as the parser reads them. A context term defined as another term of the node's contexts is refused, as one defined through one already was. The JSON-LD parse also writes the text one part per task and stops at its first error, so a failed parse leaves the main thread free after the part it failed in. Tests compare the reported files with an exported file at the same limits, until the main thread is free, and the data model and library pages describe the checks. Refs: GHSA-c6fr-r6fm-4hjm
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.
What and why
The bound on the work a deck or release file in JSON-LD may take charged each value as much as a value in an exported file. Some values the parser reports as an error and then reads on past, such as an
@idthat is no string or an@includedmember that is no node object, take it far longer than a triple and make none, so a file of them within the bound could hold the tab long after its import had failed. A term defined as another term that aliases a keyword also named that keyword unseen by the checks.refuseRemoteContextsnow refuses such values up front, under an alias too, including the members of a@setobject under the keyword it sits under, as the parser reads them. A context term defined as another term of the node's contexts is refused. The JSON-LD parse also writes the text one part per task and stops at its first error, so a failed parse leaves the main thread free after the part it failed in. Tests compare such files with an exported file at the same limits, until the main thread is free, and the data model and library pages describe the checks.Refs: GHSA-c6fr-r6fm-4hjm