chore(redact-url): redact OAuth code + assertion params (#302)#303
Merged
Conversation
…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>
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.
Closes #302.
Summary
Extends
SENSITIVE_PARAM_NAMESinapp/middleware/redact-url.jswith 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 codeassertion(RFC 7521 §4.1) — generic bearer-assertionclient_assertion(RFC 7521 §4.2 / RFC 7523) — JWT client credentialTest plan
npm run lint && npm test— 770 passing (was 768). 2 new table-driven test cases intests/unit/redact-url.test.jsdocumenting the redirect-bounce path + the RFC rationale.Proudly Made in Nebraska. Go Big Red! 🌽 https://xkcd.com/2347/