fix(security): redact credentials at every logger transport [skip-bump] - #70
Merged
Conversation
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
Hydra currently sends complete proxy credentials through the normal Winston logger during server startup. When
HYDRA_DATA_DIRis set, that same message is written into the rotatinghydra.logfile. Error stacks and structured messages can also carry OpenRouter keys, JWTs, bearer values, or auth cookies into console and support logs.This PR adds a final redaction boundary shared by every Winston transport.
sk-hydra-*,sk-proj-*, andsk-or-v1-*credentialsAuthorizationandProxy-Authorizationbearer valueshydra_tokenand__sessioncookies[object Object]Why this belongs at the logger boundary
Individual call sites should still avoid logging secrets. A final transport-level boundary provides defense in depth for startup messages, imported errors, exception stacks, and future code paths that accidentally include a credential.
The redactor preserves ordinary diagnostics and replaces only known credential shapes. It does not remove ports, account counts, event names, stack context, or error explanations.
Verification
The existing sanitization test now verifies that complete Hydra, generic proxy, OpenRouter, JWT, bearer, and cookie values cannot survive redaction, while ordinary proxy startup diagnostics remain unchanged.
This is a logging-only security fix. It does not change authentication, routing, storage, Electron behavior, API responses, or key derivation. The commit contains
[skip-bump]so merging it will not publish a desktop release.