Conversation
… catastrophic backtracking Co-authored-by: ormidales <46538211+ormidales@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] [PATCH] Fix regex backtracking issue in validateExternalUri
fix(security): add URI length cap in validateExternalUri to prevent ReDoS
Mar 13, 2026
ormidales
approved these changes
Mar 13, 2026
3 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a strict-mode URI length cap to glTF external buffer URI validation to prevent excessively long URIs from being accepted, with tests covering strict/non-strict boundary behavior.
Changes:
- Introduce
MAX_URI_LENGTH = 2048and enforce it invalidateExternalUri()whenstrictis enabled. - Add test coverage ensuring strict mode rejects >2048, allows ==2048, and non-strict mode does not apply the cap.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/core/GltfLoader.ts |
Enforces a strict-mode maximum URI length during external URI validation. |
tests/gltf.test.ts |
Adds regression tests for strict-mode URI length cap and non-strict behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Owner
|
@copilot apply changes based on the comments in this thread |
…error Co-authored-by: ormidales <46538211+ormidales@users.noreply.github.com>
Contributor
Author
Both review comments addressed in ed64cb9:
|
ormidales
approved these changes
Mar 13, 2026
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.
MAX_URI_LENGTH = 2048module-level constant inGltfLoader.tsvalidateExternalUriMAX_URI_LENGTHJSDoc to accurately describe the guard (resource exhaustion, not backtracking)len=…, max=…for easier diagnosticsOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.