From cbfabe752e1f17748f8c83863137d5f8e84d1cbb Mon Sep 17 00:00:00 2001 From: Michael Suchacz <203725896+ibetitsmike@users.noreply.github.com> Date: Wed, 26 Aug 2026 19:32:20 +0000 Subject: [PATCH 001/116] fix: redact MCP command env values and credential URLs in settings backup export The export projection treated 'command' and 'url' as fully portable strings, so env-style credentials embedded in a command (FOO_TOKEN=... cmd) and credentials inside URLs were published verbatim with an empty mcpRedactions. Redact assignment values in command strings (object and bare-string servers), redact credential-bearing URLs whole-value, and record both in the manifest so restore rehydrates them from the local config. Manifest sha256 stays computed over the redacted bytes as written. Defense in depth: createBackupPayload now hard-fails when a known credential token format survives in the finished payload, with no approval override; the local safety snapshot stays exempt. The Settings UI hides the secret-scan override for blocks that carry no approval digest. --- .../Settings/Sections/BackupSection.tsx | 12 +- .../backup/backupService.integration.test.ts | 33 ++-- src/node/services/backup/payload.test.ts | 168 ++++++++++++++++-- src/node/services/backup/payload.ts | 91 +++++++++- tests/ui/BackupSection.test.ts | 28 ++- 5 files changed, 285 insertions(+), 47 deletions(-) diff --git a/src/browser/features/Settings/Sections/BackupSection.tsx b/src/browser/features/Settings/Sections/BackupSection.tsx index 2f6a40dcc5a..1e7504ee7be 100644 --- a/src/browser/features/Settings/Sections/BackupSection.tsx +++ b/src/browser/features/Settings/Sections/BackupSection.tsx @@ -600,10 +600,10 @@ export function BackupSection() { ))}

- Provider key files and dedicated secret files have no export path. MCP commands and URLs - are included verbatim; credential-like URL components require review, while literal MCP - header values are redacted. Inside skills and memory, only documentation is published - automatically; any other file waits for you to review it. + Provider key files and dedicated secret files have no export path. Env-style values in MCP + commands, URLs carrying credentials, and literal MCP header values are redacted; + publishing a command still requires review. Inside skills and memory, only documentation + is published automatically; any other file waits for you to review it.

@@ -713,7 +713,9 @@ export function BackupSection() { )} - {secretScanBlocked ? ( + {/* A credential-format block carries no approval digest and cannot be overridden, + so a dead override control must not suggest otherwise. */} + {secretScanBlocked && secretScanApproval !== null ? (