Skip to content

fix(server): redact credentials in request logs - #33682

Merged
danieldietzler merged 1 commit into
mainfrom
fix/redact-request-logs
Nov 26, 2026
Merged

danieldietzler merged 1 commit into
mainfrom
fix/redact-request-logs

Conversation

@bo0tzz

@bo0tzz bo0tzz commented Nov 25, 2026

Copy link
Copy Markdown
Member

The debug request log printed session keys, shared link keys and API keys passed as query parameters. Those are now masked, along with more credential fields in the verbose body log.

export const redactUrl = (url: string) =>
url.replaceAll(sensitiveQueryParamRegex, (_, prefix: string) => prefix + REDACTED);

const SENSITIVE_KEYS = ['password', 'pincode', 'secret', 'token', 'verifier', 'licensekey', 'activationkey'];

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason why these keys and the ones on the spec are different ? e.g. pincode vs pinCode

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comparison is case insensitive by making it lowercase before comparing.

Comment on lines +39 to +48
describe(isSensitiveKey.name, () => {
it.each([
'password',
'newPassword',
'pinCode',
'newPinCode',
'token',
'logout_token',
'clientSecret',
'codeVerifier',

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See other comment

@danieldietzler
danieldietzler merged commit 2b39051 into main Nov 26, 2026
84 checks passed
@danieldietzler
danieldietzler deleted the fix/redact-request-logs branch November 26, 2026 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants