Skip to content

Fix JSON-string File Store body preview redaction#306

Open
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/critical-bug-investigation-8c39
Open

Fix JSON-string File Store body preview redaction#306
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/critical-bug-investigation-8c39

Conversation

@cursor

@cursor cursor Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes a File Store confirmation-preview data exposure bug where harness_create/harness_update redacted upload fields for object bodies but leaked content or content_base64 when the same body was supplied as a supported JSON string. formatBodyPreview now parses JSON-string bodies and applies the same redaction/truncation replacer before elicitation.

Bug and impact: File Store upload payloads could appear in confirmation prompts, exposing plaintext file content or encoded payloads to MCP client UI/log surfaces before multipart validation ran.

Root cause: JSON-string body inputs were coerced for dispatch, but confirmation preview used the original string and skipped key-based redaction.

Fix and validation: Added handler-level regressions for JSON-string File Store create/update payloads and updated preview formatting centrally.

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Other

Checklist

  • Tests pass
  • Typecheck passes

Validation performed:

  • pnpm exec vitest run tests/tools/tool-handlers.test.ts -t "JSON-string .*confirmation prompts" (red before fix, green after)
  • pnpm exec vitest run tests/tools/tool-handlers.test.ts tests/registry/file-store-multipart.test.ts
  • pnpm typecheck
  • pnpm build
  • git diff --check origin/main...HEAD
  • pnpm test
Open in Web View Automation 

cursoragent and others added 2 commits June 6, 2026 11:05
Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@thisrohangupta thisrohangupta marked this pull request as ready for review June 9, 2026 00:45
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