Hosted MCP file-upload confirmation omits the local source path
Description
Hosted MCP file-upload confirmation omits the local source path
Reporter: CyberSec42 (DevNest UG), reporter handle lwebmedia, security@cybersec42.com
Original audited artifact: github.com/clidey/whodb, commit c071d2bb32c99acc506fd3072f8ef241b6f30330, reviewed by the reporter on 2026-07-27.
Maintainer validation: 2026-09-28, checkout f35929f82178f1a0c7ff54b1ddf235c9a7649909.
Severity: Low. The originally reported CVSS 3.1 vector is AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:N/A:N (3.1); the validation below does not independently establish every scoring assumption.
CWE: CWE-668 (Exposure of Resource to Wrong Sphere).
Summary
In hosted platform MCP mode, whodb_platform_action with resource=file and action=upload accepts a local file_path. In default confirm-writes mode, the CLI stores the pending action and returns a confirmation preview before reading and uploading the file.
The preview redacts filePath because the shared sensitive-field predicate matches every key containing path. Both the changes list and field details conceal the source path, while the summary says only Upload file. An operator relying on this preview cannot distinguish the intended file from another file readable by the CLI process.
Calling whodb_platform_confirm with the returned token subsequently opens the stored path and sends its contents to the selected hosted project. The defect is insufficient information for informed confirmation. The investigation does not establish an unauthenticated remote file-read vulnerability, bypass of filesystem permissions, or attacker access to the uploaded file.
Preconditions and security boundary
- The operator must explicitly enable hosted platform MCP mode, authenticate, and select a workspace whose hosted capabilities and permissions allow file upload.
- A malicious or prompt-injected model must request an unintended readable local file, and review through the MCP host must fail to catch that selection.
- Default mode requires a second tool call with the confirmation token before upload. The server instructs the assistant to obtain user approval; the token itself is not independent proof of human approval. Actual user interaction depends on the MCP host and assistant behavior.
- An MCP host that presents the original tool arguments can provide an additional review opportunity. This investigation did not verify particular hosts or approval configurations.
--read-onlyand--safe-modehide hosted upload/write tools.--allow-writeexplicitly disables the CLI's confirmation requirement; the missing-path preview defect concerns confirm-writes mode.
Verified data flow
buildPlatformGenericWrite()accepts the non-emptyfile_path, trims whitespace, and stores it asfilePath. This upload path is not restricted to the current working directory.handlePlatformGenericWrite()stores the pending action.genericWriteChanges()andplatformActionFieldChanges()applysensitivePlatformWriteKey(), concealing the path.HandlePlatformConfirm()retrieves the pending action and checks that the selected host and workspace still match before execution.executePlatformMutation()dispatches toUploadProjectFile(), which callsos.Open(filePath)and constructs an authenticated GraphQL multipart upload to the configured host.whodb_platform_file_previewcan request the uploaded file's preview without another CLI write confirmation. Whether content is returned depends on hosted authorization, file type, and preview limits.
Relevant source locations at the maintainer-validated commit:
cli/pkg/mcp/platform_write_tools.go:550: file-path extraction.cli/pkg/mcp/platform_write_tools.go:668: changes-list redaction.cli/pkg/mcp/platform_write_tools.go:691: generic upload summary.cli/pkg/mcp/platform_write_tools.go:730: sensitive-field predicate.cli/pkg/mcp/platform_tools.go:1514: field-details redaction.cli/pkg/mcp/platform_tools.go:2343: confirmation handler.cli/internal/platform/write_operations.go:552: local file read and multipart upload.cli/pkg/mcp/platform_read_tools.go:618: file-preview handler.
Validation and corrections to the original proof of concept
The original report was a source-only review. Maintainer validation additionally used synthetic file contents, the actual CLI upload client and MCP handlers, and a loopback HTTP test server. No real credentials or sensitive files were used, and no live hosted service was contacted.
The local reproduction confirmed:
- The pending confirmation conceals the synthetic file's absolute path and shows
Upload file. - No upload occurs before confirmation.
- Confirmation causes the actual upload client to transmit the synthetic file bytes to the loopback server.
- The MCP read handler returns a mocked hosted text preview without an additional write confirmation. This verifies client/handler behavior, not live hosted storage or end-to-end hosted readback.
- A literal
~/.ssh/id_rsafails in the tested environment becauseos.Opendoes not expand~. The original claim that this string opens the user's SSH key is incorrect. A valid absolute path or appropriate relative path is required.
Current hosted-code inspection also limits the original readback claim: extensionless files such as id_rsa and credentials are classified as application/octet-stream, whose contents are not returned as text by the preview implementation. The claimed immediate SSH-key/credentials readback sequence is therefore not established. Previewable text files can follow the relevant content-return path, subject to authorization and preview limits. This restriction does not prevent uploading an extensionless file when a valid local path is supplied.
The existing tests also passed:
cd cli
go test ./pkg/mcp ./internal/platform \
-run 'TestHandlePlatformGenericFileUploadConfirmWritesRedactsPreview|TestUploadProjectFilePostsMultipartGraphQL' \
-count=1 -vThe first test intentionally requires the local path to remain absent from confirmation output. This confirms deliberate redaction behavior, but does not resolve the conflict between path privacy and informed approval.
Impact and status
The confirmed risk is approving an upload without seeing which local file will leave the machine. The destination is the operator's selected hosted workspace; neither attacker access to that workspace nor subsequent delivery to an attacker was demonstrated. Exposure to model context additionally depends on successful content retrieval and the surrounding client workflow.
The redaction remains present in the maintainer-validated checkout. No remediation or patched release was verified. The originally reported version range <= 0.122.0 is not an established upper bound: the same defect remains in the later checkout identified above. The complete affected release interval still needs release-history validation.
Recommended remediation
Include the exact local source path in the file-upload-specific confirmation details and summary, alongside the destination host/project/folder. Keep credential and secret redaction for other actions, and keep local paths out of unrelated logging and telemetry. Avoid globally removing path redaction from every payload type.
Update the upload confirmation regression test to require source-path visibility, continued secret redaction, and no upload before confirmation. Optional local-path restrictions are separate hardening, not a substitute for a useful approval preview.
Coordination and credit
The reporter requested coordinated remediation and consideration for a CVE, with public credit to CyberSec42 (lwebmedia). This assessment does not itself establish CVE eligibility or a publication/release decision.