fix(signals): preserve segment boundaries for globstar paths - #1426
Merged
Conversation
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1426 +/- ##
=======================================
Coverage 95.44% 95.44%
=======================================
Files 194 194
Lines 21054 21070 +16
Branches 7619 7621 +2
=======================================
+ Hits 20094 20110 +16
Misses 383 383
Partials 577 577
🚀 New features to boost your workflow:
|
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
gittensory-ui | e376c52 | Commit Preview URL Branch Preview URL |
Jun 26 2026, 09:46 AM |
Owner
Author
|
Verdict: MERGE · gittensor:bug (security). **/safe.ts was matching unsafe.ts in the manifest matcher (backs review.exclude_paths); boundary preserved, blow-up bounded, both-branch tested, green. |
This was referenced Jun 27, 2026
Closed
12 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.
Motivation
**/rewrite from removing the path-separator and turning segment globs (e.g.**/safe.ts) into broad suffix globs that match attacker-controlled filenames likeunsafe.ts.**/semantics while avoiding ReDoS and avoiding overbroad exclusions used byreview.exclude_paths.Description
**/→*rewrite with anexpandGlobstarSlashroutine that produces explicit alternatives that preserve the/segment when appropriate. (src/signals/focus-manifest.ts)src/signals/focus-manifest.ts)MAX_GLOBSTAR_SLASH_ALTERNATIVES) to bound repeated**/expansion so matcher expansion remains safe and performant. (src/signals/focus-manifest.ts)**/semantics (basename-only matches do not match suffix collisions), ensureexcludeReviewPathsno longer drops attacker-named files, and exercise bounded repeated**/expansion. (test/unit/focus-manifest.test.ts)Testing
npm test -- --run test/unit/focus-manifest.test.ts, and all tests in that file passed.npm run typecheck, andtsc --noEmitpassed.git diff --checkand it reported no issues.npm run test:coverage -- --run test/unit/focus-manifest.test.ts; the tests passed but coverage remapping failed withTypeError: jsTokens is not a functionduring coverage conversion (investigation required); this prevented completing the fulltest:coverageremap step in CI locally.npm run test:cicould not be completed locally due to the coverage remapping issue and external-network-dependent steps;npm audit --audit-level=moderatereturned a403from the registry in this environment.Codex Task