Repository navigation
fix(cli): Skip a .sentryclirc token that contains a NUL byte - #2654
Merged
Merged
Conversation
Node truncates env values at the first NUL, so the shim would send a prefix of the token. Warn and skip the token instead. Fixes #1380 Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
BYK
approved these changes
Dec 1, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1380.
Node truncates
process.envvalues at the first NUL byte. So when a.sentryclirc[auth] tokencontains a NUL,applySentryCliRcEnvShimwould setSENTRY_AUTH_TOKENto a prefix of the token, and that prefix passes bearer validation.This change makes the shim warn and skip such a token. It does not set
SENTRY_AUTH_TOKENand does not record the rc file as the token source. The boot shim still doesn't throw, so--help,auth login, andauth logoutkeep working. Env precedence doesn't change either. Since the warning names the file, the token isn't dropped silently.This replaces #2653, which kept the full token in a side table next to
process.env. A NUL in an rc token only comes from a corrupted file, and the worst case is a 401 from the server that was going to get the full token anyway. That isn't worth adding a second place where auth tokens are stored.via @BYK.
--
View Session [Sentry]