fix(storage): reject traversal segments before VikingFS access checks#557
Merged
MaojiaSheng merged 1 commit intovolcengine:mainfrom Mar 12, 2026
Merged
Conversation
Collaborator
|
/review |
Collaborator
|
great job, we'll merge soon |
MaojiaSheng
approved these changes
Mar 12, 2026
MaojiaSheng
approved these changes
Mar 12, 2026
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
MaojiaSheng
approved these changes
Mar 12, 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.
Description
Fix a path traversal / authorization bypass in
VikingFS.VikingFScurrently performs access control on the raw URI string before converting it to an AGFS storage path. However, the AGFS layer canonicalizes filesystem paths and cleans./..segments. This creates a mismatch where a crafted URI can pass OpenViking's scope-based access check but be resolved by AGFS to a different underlying path.Example attack patterns:
viking://resources/../_system/users.jsonviking://resources/../../_system/accounts.jsonviking://resources/../../other_account/_system/users.jsonThis PR hardens
VikingFSby rejecting ambiguous traversal-style path components before authorization and before URI-to-path mapping, so the object being authorized is the same object ultimately accessed by storage.Related Issue
No existing public issue. Vulnerability discovered via code audit.
Type of Change
Changes Made
VikingFSbefore access checks and URI-to-path conversion.and.., plus platform-specific ambiguous forms such as backslash-separated and drive-prefixed path componentsVikingFSboundary so read/write/rm/mv flows all reject unsafe URIs consistentlyread_file,write,rm, andmvTesting
Commands run locally:
Checklist
Screenshots (if applicable)
N/A
Additional Notes
Security impact:
_systemdata from traversal-style access attemptsBehavioral impact:
Residual note:
openviking/storage/vectordb/utils/validation.pyaboutPydanticDeprecatedSince212; this warning predates this PR and is not introduced by the current change