json-schema-org / json-schema-org/website
🐛 Bug: Unbounded recursion in getPartsOfJson can cause stack overflow on deeply nested JSON
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 169
- Forks
- 484
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 6
Description
Describe the bug
lib/getPartsOfJson.ts
getPartsOfJson recursively processes nested objects and arrays.
There is currently no recursion depth limit or input size guard.
When deeply nested JSON is processed, this can lead to:
Stack overflow
UI freeze or crash
Unresponsive editor behavior
Steps To Reproduce
-
Steps to Reproduce
-
Call getPartsOfJson with deeply nested JSON, for example:
-
{"a":{"a":{"a":{"a":{"a":{"a":{"a":1}}}}}}}
-
Observe excessive recursion depth or runtime failure
Expected Behavior
Expected Behavior
Recursion should be bounded
Extremely deep JSON should fail gracefully or be handled iteratively
Runtime should remain responsive
Actual Behavior
Recursion depth is unbounded
Deep input can crash or freeze runtime
Screenshots
No response
Device Information [optional]
- OS:
- Browser:
- version:
Are you working on this issue?
Yes
Do you think this work might require an [Architectural Decision Record (ADR)]? (significant or noteworthy)
Yes
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with lib/getPartsOfJson.ts and reproduce the failure by calling getPartsOfJson with the deeply nested JSON shown in the issue. Determine the appropriate bounded or graceful behavior, including any architectural decision required; the work is done when deeply nested input no longer overflows the stack, freezes, or crashes the runtime.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- json, typescript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100