Repository navigation
fix(gateway): redact DNS credential tokens by character, not byte - #1355
Merged
Merged
Conversation
redact_token byte-sliced the API token at offsets 4 and len-4. A Cloudflare token containing any multi-byte character puts one of those indices inside a character and panics; release builds set panic = "abort", so the process dies. The token is not validated as ASCII anywhere on the way in: CreateDnsCredential stores it and the write replicates to every peer before any read path formats it. The panic therefore lands on ListDnsCredentials/GetDnsCredential, aborting every node in the cluster rather than rejecting the bad credential. Count and slice characters instead. Short tokens keep the full mask.
kvinwang
force-pushed
the
fix/gateway-redact-token-chars
branch
from
September 24, 2026 08:16
f2f0a03 to
0265ec1
Compare
kvinwang
enabled auto-merge
September 24, 2026 08:27
kvinwang
added a commit
that referenced
this pull request
Sep 25, 2026
…cuts PR #1355 redacts DNS credential tokens by character. tc-gw-certificat-003 stores a token whose byte cuts fall inside characters and reads it back through create, get and list. Signed-off-by: Kevin Wang <wy721@qq.com>
kvinwang
added a commit
that referenced
this pull request
Nov 8, 2026
…cuts PR #1355 redacts DNS credential tokens by character. tc-gw-certificat-003 stores a token whose byte cuts fall inside characters and reads it back through create, get and list. Signed-off-by: Kevin Wang <wy721@qq.com>
kvinwang
added a commit
that referenced
this pull request
Nov 8, 2026
…cuts PR #1355 redacts DNS credential tokens by character. tc-gw-certificat-003 stores a token whose byte cuts fall inside characters and reads it back through create, get and list. Signed-off-by: Kevin Wang <wy721@qq.com>
kvinwang
added a commit
that referenced
this pull request
Nov 10, 2026
…cuts PR #1355 redacts DNS credential tokens by character. tc-gw-certificat-003 stores a token whose byte cuts fall inside characters and reads it back through create, get and list. Signed-off-by: Kevin Wang <wy721@qq.com>
kvinwang
added a commit
that referenced
this pull request
Nov 11, 2026
…cuts PR #1355 redacts DNS credential tokens by character. tc-gw-certificat-003 stores a token whose byte cuts fall inside characters and reads it back through create, get and list. Signed-off-by: Kevin Wang <wy721@qq.com>
kvinwang
added a commit
that referenced
this pull request
Nov 11, 2026
…cuts PR #1355 redacts DNS credential tokens by character. tc-gw-certificat-003 stores a token whose byte cuts fall inside characters and reads it back through create, get and list. Signed-off-by: Kevin Wang <wy721@qq.com>
kvinwang
added a commit
that referenced
this pull request
Nov 16, 2026
…cuts PR #1355 redacts DNS credential tokens by character. tc-gw-certificat-003 stores a token whose byte cuts fall inside characters and reads it back through create, get and list. Signed-off-by: Kevin Wang <wy721@qq.com>
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.
Split from #1235.
redact_tokenbyte-sliced the token (&token[..4],&token[len - 4..]). The token comes fromAdmin.CreateDnsCredential/UpdateDnsCredentialunvalidated, so a multi-byte character at either cut panics, and withpanic = "abort"the gateway dies:The credential is replicated before any read path formats it, so afterwards every
ListDnsCredentials/GetDnsCredentialaborts whichever node serves it.Fixed by counting and slicing
chars().redacts_by_characterfails againstnext.