Repository navigation
fix(internal/common): limit lexer recursion depth - #776
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Clarify in README.md and SECURITY.md that MaxQueryLength applies only to Schema.Exec.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 2
Open (2)
What changed in this PR
This PR limits parser recursion depth to reduce stack-overflow risk and documents query-size protections.
Changes:
- Adds depth tracking for selections, literals, and list types.
- Adds boundary tests for parser nesting depth.
- Documents
MaxQueryLengthand query-length security guidance. - Clarifies that
MaxQueryLengthis enforced only bySchema.Exec, notValidateorSubscribe.
| File | Summary |
|---|---|
SECURITY.md |
Adds query-length security guidance; scope MaxQueryLength to Schema.Exec. |
README.md |
Documents MaxQueryLength; clarify its enforcement scope. |
internal/query/query.go |
Guards nested selection parsing. |
internal/query/query_test.go |
Adds parser-depth boundary tests. |
internal/common/types.go |
Guards nested list types. |
internal/common/literals.go |
Guards nested literals. |
internal/common/lexer.go |
Implements recursion-depth tracking and enforcement. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
pavelnikolov
force-pushed
the
fix/add-parser-max-depth
branch
from
September 22, 2026 11:22
ab330df to
dfa14e4
Compare
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.

Uh oh!
There was an error while loading. Please reload this page.