fix: isolate temp scope by user within an account#1398
fix: isolate temp scope by user within an account#1398qin-ctx merged 5 commits intovolcengine:mainfrom
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨No code suggestions found for the PR. |
qin-ctx
left a comment
There was a problem hiding this comment.
I found two blocking issues before this temp-scope hardening is safe to merge: the temp scope root is still globally mutable for same-account users via destructive operations, and the implementation no longer preserves the documented legacy temp URI compatibility. I also left one non-blocking test coverage suggestion.
|
Resolved the blocking temp-scope follow-ups in commit 33e0892. Validated on latest PR head 33e0892:
What changed:
|
|
Addressed on the PR branch in What changed:
Validation run:
Thanks — this should cover the two blocking issues plus the follow-up regression suggestion. |
qin-ctx
left a comment
There was a problem hiding this comment.
I re-checked the latest patch after the previous feedback. The earlier temp-root mutation and legacy no-context compatibility issues are fixed, but the current legacy-temp compatibility heuristic introduces a new blocking ACL regression: a valid user space that matches the legacy temp-id pattern is now treated as globally accessible temp data.
Summary
This PR hardens OpenViking temp-scope isolation so one authenticated user can no longer read, enumerate, or overwrite another same-account user's temporary files.
Security issues covered
Before this PR
viking://temp/*was treated as accessible to any non-root authenticated user/local/{account_id}/temp/...without a user ownership segmentAfter this PR
viking://temp/<user-space>/<temp-id>tempis limited to the owning user spaceWhy this matters
Temporary files can contain uploaded inputs, parser intermediates, or working copies created during write flows. Sharing the temp namespace across all users in the same account breaks user isolation and lets one user interfere with another user's in-progress work.
Attack flow
Affected code
openviking_cli/utils/uri.pyopenviking/storage/viking_fs.pyopenviking/storage/content_write.pytests/server/test_temp_scope_acl.pyRoot cause
_is_accessible()treated the entiretempscope as universally readable/writable for non-root users.CVSS assessment
Rationale:
Safe reproduction steps
viking://temp/....viking://temp.Expected vulnerable behavior
Changes in this PR
Files changed
openviking_cli/utils/uri.pyopenviking/storage/viking_fs.pyopenviking/storage/content_write.pytests/server/test_temp_scope_acl.pyMaintainer impact
Fix rationale
Temp data should be isolated at least as strictly as other user-scoped working data. User-scoped temp URIs preserve the existing temp workflow while restoring the expected user boundary inside a shared account.
Type of change
Test plan
Executed:
python -m pytest -o addopts='' tests/server/test_temp_scope_acl.py -qDisclosure notes