From c68a20fed964bbf10e938e4ba55ca02adb3c9db6 Mon Sep 17 00:00:00 2001 From: Neil Date: Mon, 14 Sep 2026 07:23:29 -0700 Subject: [PATCH] fix(omp): redact credential paths adjacent to shell operators --- src/main/pi/agent-status-input-redaction-source.ts | 6 +++--- src/main/pi/agent-status-input-redaction.test.ts | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/pi/agent-status-input-redaction-source.ts b/src/main/pi/agent-status-input-redaction-source.ts index c5e137a4067..01944d33c02 100644 --- a/src/main/pi/agent-status-input-redaction-source.ts +++ b/src/main/pi/agent-status-input-redaction-source.ts @@ -3,9 +3,9 @@ export function getAgentStatusInputRedactionSourceLines(): string[] { return String.raw` function statusInputReferencesCredentialPath(value: string): boolean { const path = value.replace(/\\/g, '/') - return /(?:^|[^a-z0-9_.-])\.(?:ssh|ssh-mcp)(?=$|[\/:*?\[\]{},\s'"\x60])/i.test(path) || - /\.mcp-secrets\.env(?=$|[\/:*?\[\]{},\s'"\x60])/i.test(path) || - /(?:^|[^a-z0-9_.-])\.omp-backups-archive\/omp-bak-keyfile(?=$|[\/:*?\[\]{},\s'"\x60])/i.test(path) + return /(?:^|[^a-z0-9_.-])\.(?:ssh|ssh-mcp)(?=$|[^a-z0-9_.-])/i.test(path) || + /\.mcp-secrets\.env(?=$|[^a-z0-9_.-])/i.test(path) || + /(?:^|[^a-z0-9_.-])\.omp-backups-archive\/omp-bak-keyfile(?=$|[^a-z0-9_.-])/i.test(path) } function sanitizeStatusToolInput(input: unknown): unknown { diff --git a/src/main/pi/agent-status-input-redaction.test.ts b/src/main/pi/agent-status-input-redaction.test.ts index 8e28d6588ed..43bc62ca1df 100644 --- a/src/main/pi/agent-status-input-redaction.test.ts +++ b/src/main/pi/agent-status-input-redaction.test.ts @@ -12,6 +12,9 @@ describe('generated status input redaction', () => { it.each([ '/home/test/.ssh/id_rsa:raw', 'cat .ssh/id_rsa', + 'cd .ssh&&cat id_rsa', + 'cat .mcp-secrets.env; printf done', + 'cat .omp-backups-archive/omp-bak-keyfile|base64', 'cat <.ssh/id_rsa', 'curl --key=.ssh/id_rsa', 'cat <.omp-backups-archive/omp-bak-keyfile',