NemoClaw icon indicating copy to clipboard operation
NemoClaw copied to clipboard

[all platform][Security] Secret Redaction Pattern Drift Across Modules

Open zNeill opened this issue 7 months ago • 1 comments

Description

Description: NemoClaw uses three independent modules (runner.ts, debug.ts, debug.sh) to redact secrets from CLI output and diagnostic dumps. Each module maintains its own copy of the secret pattern list, but the lists have diverged — certain token formats are redacted in one module but not in others. As a result, secrets like github_pat_* fine-grained GitHub PATs and nvcf-* NVIDIA Cloud Functions tokens can leak in plaintext depending on which code path produces the output. ┌───────────────┬───────────┬──────────┬──────────┐ │ Token Pattern │ runner.ts │ debug.ts │ debug.sh │ ├───────────────┼───────────┼──────────┼──────────┤ │ nvapi-* │ Redacted │ Redacted │ Redacted │ ├───────────────┼───────────┼──────────┼──────────┤ │ nvcf-* │ Redacted │ LEAKED │ LEAKED │ ├───────────────┼───────────┼──────────┼──────────┤ │ ghp_* │ Redacted │ Redacted │ Redacted │ ├───────────────┼───────────┼──────────┼──────────┤ │ github_pat_* │ LEAKED │ Redacted │ LEAKED │ └───────────────┴───────────┴──────────┴──────────┘

[Environment] Device: Ubuntu 24.04 Node.js: v24.14.1 npm: 11.11.0 Docker: Docker version 29.1.3 OpenShell CLI: 0.0.26 NemoClaw: v0.0.11 OpenClaw 2026.4.2 (d74a122)

[Steps to Reproduce]1. Simulate runner output containing a github_pat_* token without a KEY= or Bearer prefix: node -e " const SECRET_PATTERNS = [ /nvapi-[A-Za-z0-9_-]{10,}/g, /nvcf-[A-Za-z0-9_-]{10,}/g, /ghp_[A-Za-z0-9_-]{10,}/g, /(?<=Bearer\s+)[A-Za-z0-9_.+/=-]{10,}/gi, /(?<=(?:KEY|API_KEY|SECRET|TOKEN|PASSWORD|CREDENTIAL)[=: ]['"]?)[A-Za-z0-9.+/=-]{10,}/gi, ]; function redactMatch(m) { return m.slice(0,4)+'*'.repeat(Math.min(m.length-4,20)); } function redact(s) { let o=s; for(const p of SECRET_PATTERNS){p.lastIndex=0;o=o.replace(p,redactMatch);} return o; }

const token = 'github_pat_11ABCDEF0GHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890abc'; const input = 'fatal: Authentication failed (used token: ' + token + ')'; console.log('Input: ', input); console.log('Output: ', redact(input)); console.log('Leaked: ', redact(input).includes(token)); " 2. Observe the github_pat_* token passes through runner.ts redaction completely unmasked 3. Repeat with nvcf-* token through debug.ts redact — same leak

[Expected Result] All known secret token formats are redacted consistently across all output paths (runner, debug TS, debug shell). No plaintext secret appears in CLI error messages, diagnostic tarballs, or debug logs regardless of which module produces the output.

[Actual Result] - runner.ts (src/lib/runner.ts:85-91) missing github_pat_* pattern — token appears in full plaintext in CLI error output

  • debug.ts (src/lib/debug.ts:48-53) missing nvcf-* pattern — token appears in full plaintext in diagnostic dumps
  • debug.sh (scripts/debug.sh:125-131) missing both github_pat_* and nvcf-* — tokens appear in plaintext in shell-based diagnostics

[Root Cause]

Three modules independently define their own secret pattern lists with no shared source of truth. When github_pat_* support was added to debug.ts and nvcf-* to runner.ts, the corresponding patterns were not propagated to sibling modules.

Bug Details

Field Value
Priority Unprioritized
Action Dev - Open - To fix
Disposition Open issue
Module Machine Learning - NemoClaw
Keyword NemoClaw, NEMOCLAW_GH_SYNC_APPROVAL, NemoClaw-SWQA-RelBlckr-Recommended

[NVB# 6066759]

[NVB#6066759]

zNeill avatar Apr 10 '26 12:04 zNeill

Verified bug fixed with v0.0.14

Rohitkalidindi avatar Apr 13 '26 20:04 Rohitkalidindi