Repository navigation
fix(security): tool results carry a teammate as id, name, email and picture only - #3
Open
boehlerlukas wants to merge 1 commit into
Open
boehlerlukas wants to merge 1 commit into
boehlerlukas wants to merge 1 commit into
Conversation
…icture only Moved from the private archive repo (PR #119 there). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Moved from the private archive (MCP-server-archive PR #119) when this repo was published with a fresh history. Original author: @floooat.
Problem
The Gleap API fills in tickets and messages with the whole dashboard user record of the assignee (
processingUser) or sender (a message'suser), and the tools passed it straight on.assign_ticket,close_ticket,get_ticketandsend_message(and every other tool that returns a ticket or message) put these fields into each MCP client's context and transcript:token: the one-time reCAPTCHA response that old sign-ups still storegaClientIdnotificationSettingsandnotificationPreferencesonboardingFlow,lastAutoAssignand similarChange
src/utils/userRecordRedaction.tsholds one serialiser,toPublicUser(_id,id,email,firstName,lastName,profileImageUrl), and a walk that finds user records at any depth. A user record is an object with an identity field plus a field that only the Server'sUsermodel has. Contacts havenameand none of those fields, and the slimget_usersentries (role, availability) don't match either, so both pass through unchanged.applyShareTokenRedaction, the outermost result wrapper, also runs it. That covers every tool, current and future, on both success and error results, without touchingsrc/index.ts.tokenandgaClientIdvalues are replaced, the same way the share-token redaction does it.AGENTS.md lists the redaction under "stop and ask". This PR is that change, made on purpose.
Tests
tests/user-record-redaction.test.tscalls the real endpoint and was committed first. It failed on the four named tools and on 68 tools in a sweep where the API stub returns full user records everywhere. It also checks that a ticket's contact and theget_usersrole and availability are left alone.src/utils/userRecordRedaction.test.tscovers the module itself: detection, input not changed, running it twice gives the same result, the text fallbacks, and text without a user record left as is.Results:
npm run typecheck: exit 0npm run test:coverage: 1383 of 1383 pass, coverage floors metnpm run build: exit 0npm run quality: 0 problems, 0 warningsNot in this PR
Server side: GleapSDK/Server#3176 keeps
tokenout ofUserProjectionFULL, INTERNAL and SECURE. The other user fields still go out wherever those projections are used:MESSAGE_RECEIVEDand theTICKET_UPDATEDthatcontact.updatedsendsAn inclusion projection for those populates would fix it at the source.
The reporter's contact on
get_ticket:eventDataandoutboundHistoryare still returned in full. The widget credentials were already stripped. Trimming the rest changes whatget_ticketreturns, so it's left for a product decision.🤖 Generated with Claude Code