Skip to content

fix(debug): redact vendor credential headers and fields - #555

Open
connabyss wants to merge 1 commit into
Tencent:mainfrom
connabyss:fix/redact-vendor-token-headers
Open

connabyss wants to merge 1 commit into
Tencent:mainfrom
connabyss:fix/redact-vendor-token-headers

Conversation

@connabyss

Copy link
Copy Markdown

Summary

Debug network evidence masks a header only when its whole lowercase name is in the fixed SECRET list (authorization, cookie, x-api-key, x-auth-token, ...). Common vendor credential headers are not in it, so their values were retained as sent:

  • GitLab PRIVATE-TOKEN
  • Google x-goog-api-key
  • AWS x-amz-security-token
  • Azure Ocp-Apim-Subscription-Key
  • Vault x-vault-token, plus x-access-token and x-client-secret

JSON body fields with the same shape (private_token, x_goog_api_key) were kept the same way. A name whose last -/_ part is token, api key, secret, subscription key or password is now treated as secret too, for headers and for URL/JSON field names. Ordinary headers such as x-request-id, idempotency-key and x-tokenizer are unchanged.

Tests

New cases in apps/extension/src/debug/__tests__/redact.test.ts: the seven headers above, the two JSON fields, and four ordinary headers that must stay as they are. The eight secret cases fail without the change in redact.ts and pass with it.

  • pnpm --filter @browser-skill/extension test: 195 files, 3580 tests passed
  • npx biome check .: clean
  • tsc --noEmit in apps/extension: clean

I used Claude Code to find this, write the fix and tests, and run the checks above.

Debug network evidence masked a header only when its whole name was in the
fixed secret list, so common vendor credential headers kept their values:
GitLab `PRIVATE-TOKEN`, Google `x-goog-api-key`, AWS `x-amz-security-token`,
Azure `Ocp-Apim-Subscription-Key`, Vault `x-vault-token`, `x-access-token`
and `x-client-secret`. JSON body fields such as `private_token` were kept
the same way. A name whose last part is token, api key, secret,
subscription key or password is now treated as secret too.

Assisted-by: Claude Code
@NianJiuZst
NianJiuZst self-requested a review November 3, 2026 06:09
@NianJiuZst NianJiuZst self-assigned this Nov 3, 2026

This branch has not been deployed

No deployments
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