Skip to content

fix(cli): Redact sensitive flag values in unknown command telemetry - #2115

Merged
BYK merged 1 commit into
mainfrom
abdullahkhan/cli-unknown-command-redaction
Nov 9, 2026
Merged

BYK merged 1 commit into
mainfrom
abdullahkhan/cli-unknown-command-redaction

Conversation

@Abdkhan14

Copy link
Copy Markdown
Contributor

reportUnknownCommand() builds pathSegments, unknown_token, the org and project guess, and arg_count from raw argv before redacting. That means a sensitive flag value (e.g. --token) survives in two ways: as a path segment that becomes unknown_token for the --flag VALUE form, and as the argv.at(-1) fallback for the --flag=VALUE form.

Move redactArgv() to the top of the function and use safeArgv for every derived field.

Refs VDY-366

Verification

  • sentry alert --token SECRET and sentry alert --token=SECRET both no longer appear in unknown_command telemetry context
  • Test fails without the fix (SECRET appears in unknown_token), passes with it
  • pnpm run typecheck && pnpm run lint clean

reportUnknownCommand() derived pathSegments, unknown_token, org/project, and arg_count from raw argv before redacting. A sensitive flag value (e.g. --token SECRET) survived as a path segment and appeared verbatim in unknown_token. The --flag=VALUE form also leaked through the argv.at(-1) fallback.

Move redactArgv() to the top of the function and use safeArgv for every derived field.

Refs VDY-366

Co-authored-by: Cursor <cursoragent@cursor.com>
@vercel

vercel Bot commented Nov 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
sentry-local Skipped Skipped Nov 9, 2026 6:02pm UTC

Request Review

@linear-code

linear-code Bot commented Nov 9, 2026

Copy link
Copy Markdown

VDY-366

@Abdkhan14
Abdkhan14 marked this pull request as ready for review November 9, 2026 18:11
@evanpurkhiser
evanpurkhiser requested a review from BYK November 9, 2026 18:14
@BYK
BYK merged commit 12be99c into main Nov 9, 2026
26 checks passed
@BYK
BYK deleted the abdullahkhan/cli-unknown-command-redaction branch November 9, 2026 19:01

This branch was previously deployed

1 inactive deployment
Preview — b05841d5 Deployed Nov 9, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants