Skip to content

fix(solid): bound how deep a Turtle text may nest - #653

Merged
ixuz merged 1 commit into
mainfrom
fix/turtle-nesting-depth
Nov 8, 2026
Merged

ixuz merged 1 commit into
mainfrom
fix/turtle-nesting-depth

Conversation

@ixuz

@ixuz ixuz commented Nov 8, 2026

Copy link
Copy Markdown
Member

What and why

The read limits held a Turtle text to its bytes, its triples and the characters of their terms. The parser makes the triple that links a nested collection, blank node, annotation or triple term to the level above only once that level closes, and keeps a context for every open level. A text that only opened levels made no triple to count, so only its size bounded the memory the parse held.

  • The scan that already looks through every Turtle text before the parser reads it now also counts the levels it opens and closes, past strings, IRIs and comments, and refuses a text nested more than 64 levels deep with a ReadLimitError, with limits or with none.
  • Every Turtle read goes through that scan, on either client: pod documents, releases, profiles, access controls and deck files.
  • The app's own documents and the library's releases nest a few levels; the deepest file in the repository nests 2.
  • One contract test that nested a triple term 100 deep now nests it 30 deep, so it still tests the parser's own refusal; the deeper text is refused by the new bound.
  • The read-limit rules in docs/deck-library.md, docs/data-model.md, docs/boundaries.md and docs/testing.md, and the doc comments that list what a read refuses, name the bound.

Refs: GHSA-qv47-r346-839c

The read limits held a Turtle text to its bytes, its triples and the
characters of their terms. The parser makes the triple that links a
nested collection, blank node, annotation or triple term to the level
above it only once that level closes, and keeps a context for every
level it is in. A text that only opened levels made no triple to
count, so only its size bounded the memory the parse held, and a
release or a foreign instance's document within the byte limit could
use up the tab's memory.

The scan that already looks through every Turtle text before the
parser reads it, for its base and prefix declarations and long IRIs,
now also counts the levels it opens and closes, past strings, IRIs
and comments, and refuses a text nested more than 64 levels deep with
a ReadLimitError, with limits or with none. Every Turtle read goes
through it, on either client: pod documents, releases, profiles,
access controls and deck files. The app's own documents and the
library's releases nest a few levels.

Refs: GHSA-qv47-r346-839c
@ixuz ixuz added the bug Something isn't working label Nov 8, 2026
@ixuz
ixuz enabled auto-merge November 8, 2026 12:42
@ixuz
ixuz added this pull request to the merge queue Nov 8, 2026
Merged via the queue into main with commit df4731b Nov 8, 2026
51 checks passed
@ixuz
ixuz deleted the fix/turtle-nesting-depth branch November 8, 2026 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant