Skip to content

chore(redact-url): add OAuth2 token names to the sensitive-param set#281

Merged
CryptoJones merged 1 commit into
masterfrom
fix/redact-url-add-oauth-token-names
May 19, 2026
Merged

chore(redact-url): add OAuth2 token names to the sensitive-param set#281
CryptoJones merged 1 commit into
masterfrom
fix/redact-url-add-oauth-token-names

Conversation

@CryptoJones
Copy link
Copy Markdown
Owner

Summary

The redact-url middleware (used by the pino-http request serializer) strips known-sensitive query-parameter values before the URL hits the structured log. The existing set covered authkey, apikey, api_key, token, access_token, password, and secret.

This API doesn't issue OAuth2 tokens itself, but operators sometimes front the service with an OAuth proxy whose redirect / error paths bounce a ?refresh_token=… or ?id_token=… through one of our URLs. Adding these and client_secret as defense in depth means a log line captured during that flow doesn't become the leak vector — even though we're not the original token issuer.

Test plan

  • npm run lint && npm test — 760 passing.
  • The existing test in tests/unit/redact-url.test.js iterates over SENSITIVE_PARAM_NAMES and asserts each one redacts, so coverage extends automatically.

Proudly Made in Nebraska. Go Big Red! 🌽 https://xkcd.com/2347/

The redact-url middleware strips a small allowlist of known-sensitive
query parameter values before the URL hits the structured log.
\`authkey\`, \`apikey\`, \`api_key\`, \`token\`, \`access_token\`,
\`password\`, and \`secret\` were already covered.

This API doesn't issue OAuth2 tokens itself, but operators sometimes
front the service with an OAuth proxy whose redirect / error paths
bounce a \`?refresh_token=...\` or \`?id_token=...\` through one of our
URLs. Adding these and \`client_secret\` as defense-in-depth means a
log line captured during that flow doesn't become the leak vector.

The existing test in tests/unit/redact-url.test.js iterates over
SENSITIVE_PARAM_NAMES and asserts each one redacts — so coverage
extends automatically without a code change to the test file.

760 tests still pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@CryptoJones CryptoJones merged commit 38fa537 into master May 19, 2026
3 checks passed
@CryptoJones CryptoJones deleted the fix/redact-url-add-oauth-token-names branch May 19, 2026 15:26
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.

1 participant