Messaging Tokens (Slack/Discord/Telegram) Leaked in Onboarding Sessions
Description
A critical credential leak exists in NemoClaw's onboarding process. If an onboarding step fails, the onboard-session.ts module saves the error message to ~/.nemoclaw/onboard-session.json. The redactSensitiveText function used to sanitize this file only checks a hardcoded list of standard API keys (e.g., NVIDIA_API_KEY, OPENAI_API_KEY), completely missing tokens for messaging integrations.
Furthermore, the central redaction patterns in src/lib/secret-patterns.ts (used to sanitize CLI output and logs) are missing the standalone prefixes for Slack (xoxb-, xapp-), Telegram (\d+:[A-Za-z0-9_-]{20,}), and Discord.
As a result, if a user inputs an invalid Slack, Discord, or Telegram token if the network request fails the raw token is printed in plain text to the console and permanently saved in the unencrypted onboard-session.json file.
Reproduction Steps
- Run nemoclaw onboard.
- Proceed to the "Messaging channels" step.
- Select "Telegram" and enter an intentionally invalid token like 1234567890:AAH-invalid-token.
- Observe that the network probe fails and prints the token to the CLI output.
- Inspect the ~/.nemoclaw/onboard-session.json file; the token will be visible in the failure.message field.
Environment
- OS: Windows 11
- Node.js: v24.14.0
- Docker: Docker Desktop
- NemoClaw: v0.1.0
Debug Output
Not applicable this is a static security vulnerability identified via code audit, not a runtime crash.
Logs
Reproduction Example:
$ nemoclaw onboard
...
Available messaging channels:
[1] ○ telegram Telegram Bot (configured)
...
⚠ Bot token was rejected by Telegram verify the token is correct.
Failed to reach https://api.telegram.org/bot1234567890:AAH-invalid-token/getMe
# The token (1234567890:AAH-invalid-token) is printed in plain text instead of being redacted.
# It is also saved unredacted to ~/.nemoclaw/onboard-session.json
Checklist
- [x] I confirmed this bug is reproducible
- [x] I searched existing issues and this is not a duplicate
✨ Thanks for submitting this issue that raises a security concern — this may involve a security-sensitive area and could help improve the security of the NemoClaw onboarding process.