Skip to content

fix(writer): prevent metadata leakage in search response - #520

Open
DikshaJadhav3110 wants to merge 4 commits into
frappe:developfrom
DikshaJadhav3110:fix/writer-search-leak
Open

fix(writer): prevent metadata leakage in search response#520
DikshaJadhav3110 wants to merge 4 commits into
frappe:developfrom
DikshaJadhav3110:fix/writer-search-leak

Conversation

@DikshaJadhav3110

Copy link
Copy Markdown
Collaborator

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.

@greptile-apps

greptile-apps Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Reviews (3): Last reviewed commit: "Merge remote-tracking branch 'upstream/d..." | Re-trigger Greptile

Comment thread suite/writer/api/general.py

@BreadGenie BreadGenie left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants