Skip to content

chore(redact-url): redact OAuth code + assertion params (#302)#303

Merged
CryptoJones merged 1 commit into
masterfrom
chore/redact-url-oauth-code-assertion
May 19, 2026
Merged

chore(redact-url): redact OAuth code + assertion params (#302)#303
CryptoJones merged 1 commit into
masterfrom
chore/redact-url-oauth-code-assertion

Conversation

@CryptoJones
Copy link
Copy Markdown
Owner

Closes #302.

Summary

Extends SENSITIVE_PARAM_NAMES in app/middleware/redact-url.js with three RFC-specified OAuth query-string params that can ride into the structured log via redirect bounces and weren't on the allowlist:

  • code (RFC 6749 §4.1) — short-lived but replay-capable authorization code
  • assertion (RFC 7521 §4.1) — generic bearer-assertion
  • client_assertion (RFC 7521 §4.2 / RFC 7523) — JWT client credential

Test plan

  • npm run lint && npm test — 770 passing (was 768). 2 new table-driven test cases in tests/unit/redact-url.test.js documenting the redirect-bounce path + the RFC rationale.

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

…logs

The redact-url middleware already covered access_token, refresh_token,
id_token, and client_secret. Three more OAuth query-string params can
ride into our logs via redirect bounces and were not on the allowlist:

- `code` (RFC 6749 §4.1) — single-use OAuth authorization code.
  Short-lived but a leaked log line containing one is enough to
  attempt a replay before the legitimate exchange completes.
- `assertion` (RFC 7521 §4.1) — generic bearer-assertion param.
- `client_assertion` (RFC 7521 §4.2 / RFC 7523) — JWT used as
  client credential. Doesn't expire for minutes to hours and is
  unambiguously credential-bearing.

We don't issue OAuth tokens ourselves, but operators fronting this
API with an OAuth proxy may have error handlers that bounce through
/v1/* paths with these params still attached.

Add two table-driven assertions in tests/unit/redact-url.test.js to
document the new redactions and the rationale.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@CryptoJones CryptoJones merged commit 9d83774 into master May 19, 2026
3 checks passed
@CryptoJones CryptoJones deleted the chore/redact-url-oauth-code-assertion branch May 19, 2026 17:00
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.

redact-url: add OAuth code + RFC 7521/7523 assertions to the redact list

1 participant