Repository navigation
Conversation
Signed-off-by: Robert McConnell <[email protected]>
Signed-off-by: Robert McConnell <[email protected]>
Signed-off-by: Robert McConnell <[email protected]>
Collaborator
|
@mcc0nnell could you please rebase the PR? |
Collaborator
|
I am not sure we should support env vars for this. Would not be the args also visible for the CLI / regular MCP server args? Let's document that users can use |
OrKoN
requested changes
Oct 1, 2026
OrKoN
left a comment
Collaborator
There was a problem hiding this comment.
marked as requested changes
Contributor
Author
twotnguyen
pushed a commit
to twotnguyen/chrome-devtools-mcp
that referenced
this pull request
Oct 16, 2026
…vTools#2901) ## Summary - Redact WebSocket header values and URL credentials (userinfo and query parameters) before logging Puppeteer connection options. - Redact `--wsHeaders` / `--ws-headers` and connection endpoint arguments in the daemon startup log, while passing the original arguments to the spawned daemon. - Keep the redaction helpers in `src/utils/logger.ts` rather than expanding the `BrowserManager` public API. - Verify the actual `ensureBrowser()` path sends unmodified credentials to `puppeteer.connect`, alongside focused URL/daemon logging regression tests. ## Scope This is the logging-safety piece split out of ChromeDevTools#2764. It does not add environment-variable transport or change `wsHeaders` precedence or CLI serialization. ## Validation (Butcher; PR-pinned devtools-frontend revision) - `npm run format` — passed - `npm run build` — passed - `node scripts/test.js --test-name-pattern='preserves WebSocket|sensitive connection logging' tests/browser.test.ts tests/utils/logger.test.ts` — passed (7 selected tests) - `git diff --check` — passed Updated in c5b9bdc. --------- Signed-off-by: Robert McConnell <[email protected]>
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
wsHeadersacross the CLI → daemon → MCP handoff without serializing header values into daemon argvCHROME_DEVTOOLS_MCP_WS_HEADERSas a secret-friendly input for direct users--wsHeaderscompatibilityWhy
wsHeadersis coerced from JSON into an object. The daemon path currently runs structured options through the generic serializer, which turns the object into[object Object].A straightforward
JSON.stringifyfix would restore propagation, but it would also place values such asAuthorization: Bearer ...into the long-lived daemon/MCP process argv. This patch instead removes resolved headers from daemon argv and passes them through a dedicated inherited environment channel.The internal resolved-header variable is consumed only in
--viaClimode so parent-resolved precedence is preserved when the child reparses configuration. The public environment variable remains a fallback for direct invocation and does not override an explicit flag or config value. Both secret-bearing environment variables are deleted after parsing so they are not inherited by subsequently launched Chrome processes.The browser connection path also logged the entire Puppeteer connect-options object. Because that object contains
wsHeaders, enabling--logFilecould otherwise persist header values after moving them out of argv. Header names remain visible for diagnostics, but all header values are now replaced with[REDACTED]in that log representation without modifying the options passed to Puppeteer.Verification
npm run typechecknpm run check-formatnpm run test -- tests/cli.test.ts tests/daemon/utils.test.tsnpm run genAll commits are signed and include DCO
Signed-off-bytrailers.Security context has also been reported through Google OSS VRP (Issue 563146214).