Summary
The OAuth2 debug logging path (using the debug('oauth2') calls) logs the full requestConfig and data objects verbatim, which includes sensitive client authentication material:
The leak pre-existed this PR for the first two cases; PR #8051 added JWT assertions to the set of material flowing through the same path.
Proposed fix
Add a redaction helper that, before the debug log is built, creates sanitized shallow clones of requestConfig.headers and the form data object, replacing sensitive keys (Authorization, client_secret, client_assertion, client_assertion_type) with a [REDACTED] placeholder. The original objects must remain unchanged so the actual HTTP request continues to send real credentials.
Apply the helper in both:
packages/bruno-requests/src/auth/oauth2-helper.ts (around the debug('oauth2')('> request') call)
packages/bruno-electron/src/utils/oauth2.js (matching log site)
References
Summary
The OAuth2 debug logging path (using the
debug('oauth2')calls) logs the fullrequestConfiganddataobjects verbatim, which includes sensitive client authentication material:Authorization: Basic <base64(client_id:client_secret)>forclient_secret_basicclient_secretin the form body forclient_secret_postclient_assertionJWTs forclient_secret_jwt/private_key_jwt(widened by PR feat(oauth2): full set of token-endpoint client authentication methods (RFC 7591 / 7523 / 8705) #8051)The leak pre-existed this PR for the first two cases; PR #8051 added JWT assertions to the set of material flowing through the same path.
Proposed fix
Add a redaction helper that, before the debug log is built, creates sanitized shallow clones of
requestConfig.headersand the formdataobject, replacing sensitive keys (Authorization,client_secret,client_assertion,client_assertion_type) with a[REDACTED]placeholder. The original objects must remain unchanged so the actual HTTP request continues to send real credentials.Apply the helper in both:
packages/bruno-requests/src/auth/oauth2-helper.ts(around thedebug('oauth2')('> request')call)packages/bruno-electron/src/utils/oauth2.js(matching log site)References