fix(writer): prevent metadata leakage in search response - #520
Open
DikshaJadhav3110 wants to merge 4 commits into
Open
fix(writer): prevent metadata leakage in search response#520DikshaJadhav3110 wants to merge 4 commits into
DikshaJadhav3110 wants to merge 4 commits into
Conversation
Contributor
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Reviews (3): Last reviewed commit: "Merge remote-tracking branch 'upstream/d..." | Re-trigger Greptile |
BreadGenie
requested changes
Aug 10, 2026
BreadGenie
left a comment
Member
There was a problem hiding this comment.
can you setup pre-commit locally so that linters won't trip in CI?
…sting lint Reformats the new test per ruff-format and silences B035 on an unrelated dict comprehension in get_drive_file_meta that predates this PR; that bug will be filed and fixed separately.
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.
The Writer search API correctly removes documents that the user doesn't have permission to access. However, it still returns the search summary (match counts and spelling suggestions) without applying the same permission check.
Because of this, a user searching for something in a private document could still learn that the document exists, and in some cases even discover confidential words through the spelling suggestions, even though the search results are empty.
This fix updates the summary after permission filtering, so the match counts only reflect documents the user can actually access, and removes the unused spelling-correction fields to avoid leaking information.