fix(core): redact URL userinfo credentials in shared redactors - #4597
Open
Rangsh wants to merge 2 commits into
Open
fix(core): redact URL userinfo credentials in shared redactors#4597Rangsh wants to merge 2 commits into
Rangsh wants to merge 2 commits into
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.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.
Summary
Shared redactors in
@maka/corealready masked URL query secrets (?token=…) but left URL userinfo credentials (https://user:pass@host/…) intact unless the secret happened to match a fixed provider prefix such asghp_. That leak showed up in ordinary shell output (git remote -v, push/fetch errors) viashell-run-managerandpty-screen-collector.This PR adds a structural userinfo step to both
redaction.tsanddisplay-redaction.ts(before the query-secret step): for eachhttps?://authority that contains@, replace everything through the last@with the redaction marker while preserving host and path. No provider-prefix list is required. The display pattern also declaresstreamingTerminator/streamingValueGroupso streaming-suffix redaction keeps its contract.Fixes #4593
Verification
npm --workspace @maka/core run buildnode --test packages/core/dist/__tests__/redaction.test.js packages/core/dist/__tests__/display-redaction.test.js— passnpm --workspace @maka/core run test:dist— 798 pass / 0 failnpm --workspace @maka/ui run buildnode --test packages/ui/dist/__tests__/streaming-display-redaction.test.js— 15 pass / 0 failNot run: full monorepo
npm test, lint/format/typecheck across unrelated workspaces.AI use
Select exactly one:
Tool(s) and scope:
Cursor (Composer) drafted the userinfo redaction changes in
packages/core/src/redaction.tsandpackages/core/src/display-redaction.ts, added the covering tests, and prepared the commit/push. Human review and PR submission remain with the author.Checklist
Does this PR entail a change in behavior?