You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This report is generated by an experimental AI review fleet and is provided as a beta feature. Findings are a starting point for discussion, not a gate. Use your own judgement.
getFullSummaryDirectory() was changed to throw a 400 NetworkError when documentId (sourced from the Storage-Routing-Id header) is empty or fails isInvalidRepoPathComponent, closing a path-traversal hole. No test exercises this new validation or its call sites (lines 85, 132, 205). summaries.spec.ts only ever passes valid uuid() values as documentId, so a regression that removes/weakens the check (or a future change to isInvalidRepoPathComponent) would not be caught by any test in this package.
Add a test in summaries.spec.ts (or a new unit test around getFullSummaryDirectory if exported) that hits one of the summary routes with a Storage-Routing-Id documentId of ".." (and/or "" and "a/b"), and asserts the response is a 400 with a message matching /Invalid document id/, and that no filesystem access outside the repo directory occurs.
isInvalidRepoPathComponent explicitly checks path.win32.isAbsolute(value) to catch Windows-style absolute paths (e.g. "C:\foo" or "\foo"), but helpers.spec.ts only tests the POSIX absolute case ("/etc"). The equivalent Windows-style cases are covered for containsPathTraversal in services-shared/src/test/http.spec.ts ("\path") but not for this near-identical gitrest helper, so a regression that drops the win32.isAbsolute check here would go undetected.
Add a test in helpers.spec.ts: assert.throws(() => getRepoPath("tenant", "\\etc"), /Invalid repo name \(documentId\)/) and one for a drive-letter path like getRepoPath("tenant", "C:\\etc"), both expected to throw.
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
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.
Fix flagged parse traversal by MSRC team