fix(logging): redact sensitive query params and gate WS payload logs#133
Merged
andreasjansson merged 10 commits intomainfrom Feb 2, 2026
Merged
fix(logging): redact sensitive query params and gate WS payload logs#133andreasjansson merged 10 commits intomainfrom
andreasjansson merged 10 commits intomainfrom
Conversation
Fixes #85 - CDP_SECRET and other sensitive params like tokens were being logged in plain text. Now any query param containing secret, token, key, password, auth, or credential (case-insensitive) is redacted.
Fixes #117 - WebSocket message payloads (which can contain sensitive user content, authentication data, or tokens) were being logged in production. Now verbose payload logging is only enabled when DEBUG_ROUTES=true.
Regression tests for #85 - ensures sensitive query params like secret, token, key, password, auth, credential are properly redacted from logs.
Move the function to a separate module to make it testable without pulling in heavy sandbox dependencies.
The CDP endpoint returns 503 when CDP_SECRET isn't configured. Instead, use simple curl requests and just verify logs are correct.
The redacted value appears as %5BREDACTED%5D in logs due to URL encoding.
CarlosCASAWiki
pushed a commit
to CarlosCASAWiki/moltworker
that referenced
this pull request
Mar 11, 2026
fix(logging): redact sensitive query params and gate WS payload logs
This was referenced Mar 28, 2026
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.



Summary
Fixes #85 - CDP_SECRET and other sensitive query params were being logged in plain text
Fixes #117 - WebSocket message payloads (which can contain sensitive user content) were being logged in production
Changes
Security fixes:
secret,token,key,password,auth, orcredential(case-insensitive) is now redacted to[REDACTED]in logsDEBUG_ROUTES=trueNew files:
src/utils/logging.ts- ContainsredactSensitiveParams()functionsrc/logging.test.ts- Unit tests for redaction logic (13 tests)test/e2e/log_redaction.txt- E2E cctr tests verifying logs don't contain secretsTesting
[REDACTED]placeholder appears instead[REQ]lines