Widen turbopack chunk filename allowlist (defensive)#8018
Closed
gilluminate wants to merge 2 commits intomainfrom
Closed
Widen turbopack chunk filename allowlist (defensive)#8018gilluminate wants to merge 2 commits intomainfrom
gilluminate wants to merge 2 commits intomainfrom
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
Codecov Report✅ All modified and coverable lines are covered by tests. ❌ Your project status has failed because the head coverage (84.96%) is below the target coverage (85.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #8018 +/- ##
==========================================
- Coverage 84.97% 84.96% -0.01%
==========================================
Files 631 631
Lines 41239 41239
Branches 4787 4787
==========================================
- Hits 35041 35038 -3
- Misses 5113 5114 +1
- Partials 1085 1087 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Follow-up to #8005. The turbopack allowlist regex introduced there assumed a single alphanumeric extension after the "..", but turbopack also emits chunks like "0~9kfdw7..yey.js" where the trailing segment itself contains dots. The narrow regex rejected these, so the catchall handed the browser HTML in place of JS and reproduced the same blank-screen SyntaxError. Widen the trailing character class to include word chars, dots, tildes, and hyphens. The leading segment still requires at least one alphanumeric/tilde/hyphen character, which keeps "..", "...", "....", "..foo", "foo..", and overlong-UTF-8 variants rejected. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
7814902 to
12e518e
Compare
Contributor
Author
|
will address differently after more thorough research |
gilluminate
added a commit
that referenced
this pull request
Apr 28, 2026
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
18 tasks
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.
Ticket [no-ticket]
Description Of Changes
Follow-up to #8005. The allowlist regex introduced there matched only a single alphanumeric extension after the
.., so chunks like0~9kfdw7..yey.js,0te-shorr2._..js, andabc-123..part.min.jsstill trippedsanitise_url_pathand got routed through the admin UI index fallback.admin-ui has since been reverted to
next build --webpack, so this regex isn't currently fixing a live bug — webpack-built chunks don't contain..in the first place. But keeping the allowlist in shape is cheap defensive insurance for the eventual turbopack migration (once the upstream Next.js static-export issues settle down), and it plugs a gap in what #8005 claimed to cover.Widen the trailing character class to allow word chars, dots, tildes, and hyphens on both sides of the
... The first character is still constrained to a non-dot, which keeps..,...,....,..foo,foo.., and overlong-UTF-8 variants (e.g...\xc0) out of the allowlist and subject to the existing substring guard.Code Changes
src/fides/api/main.py— widenTURBOPACK_CHUNK_REfrom^[\w~-]+\.\.[a-z]+$to^[\w~-][\w~.-]*\.\.[\w~.-]+$tests/ops/util/test_api_router.py— add turbopack cases with dotted segments on either side of the..Steps to Confirm
pytest tests/ops/util/test_api_router.py::TestApiRouter::test_sanitise_url_path— all cases pass (existing malicious rejections preserved, new turbopack cases accepted).python -c "from fides.api.main import sanitise_url_path, MalisciousUrlException; [sanitise_url_path(p) for p in ['/_next/static/chunks/0y3j4e~tvxaz..js', '/_next/static/chunks/0~9kfdw7..yey.js', '/_next/static/chunks/0te-shorr2._..js', '/_next/static/chunks/abc-123..part.min.js']]"returns without raising.Pre-Merge Checklist
CHANGELOG.mdupdated_clientMiddlewareManifest.jsin CI before the eventual turbopack migrationmaindowngrade()migration is correct and works