[mirror] fix(security): enforce document set access in search filters (#10602) to release v3.3#6
Open
yashwant86 wants to merge 1 commit intomm-base-10612from
Open
[mirror] fix(security): enforce document set access in search filters (#10602) to release v3.3#6yashwant86 wants to merge 1 commit intomm-base-10612from
yashwant86 wants to merge 1 commit intomm-base-10612from
Conversation
…t-app#10602) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
⚡ Risk Assessment —
|
| Files | Summary |
|---|---|
Document Set Access Enforcementbackend/onyx/chat/process_message.pybackend/onyx/context/search/pipeline.pybackend/onyx/db/document_set.py |
Adds document set access validation at two enforcement points: in chat message processing before tool invocation, and in search pipeline filter building. New helper function filters document set names by user view access, raising OnyxError if unauthorized names are detected. |
Integration Testsbackend/tests/integration/tests/chat/test_chat_document_set_access.py |
Adds comprehensive integration tests covering document set access enforcement: blocks unauthorized names, allows authorized names, permits public document sets, and rejects non-existent names to prevent enumeration. |
Sequence Diagram
sequenceDiagram
participant User
participant ChatAPI as Chat API
participant Validator as Access Validator
participant DB as Database
participant SearchPipeline as Search Pipeline
User->>ChatAPI: send-chat-message with document_set filter
ChatAPI->>Validator: _stream_chat_turn (check filters)
Validator->>DB: filter_document_set_names_by_user_access
DB-->>Validator: accessible_names
alt Unauthorized names found
Validator-->>ChatAPI: raise OnyxError (INSUFFICIENT_PERMISSIONS)
ChatAPI-->>User: StreamingError in response
else All names authorized
ChatAPI->>SearchPipeline: _build_index_filters
SearchPipeline->>DB: filter_document_set_names_by_user_access (second check)
DB-->>SearchPipeline: accessible_names
SearchPipeline-->>ChatAPI: validated filters
ChatAPI-->>User: proceed with search
end
Dig Deeper With Commands
/review <file-path> <function-optional>/chat <file-path> "<question>"/roast <file-path>
Runs only when explicitly triggered.
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.
Mirror of upstream onyx-dot-app#10612 for benchmark. Do not merge.
Summary by MergeMonkey