fix: redact access key in public command accessor and inspect (CWE-312) - #47
Merged
Merged
Conversation
The public `command` method returned the start command string with the BrowserStack access key interpolated verbatim, so any caller that logged it (CI output, test runner logs, APM/error trackers) leaked the credential to a wider audience than the key itself. Ruby's default #inspect had the same problem, dumping @key when a Local instance was logged or raised. - command now returns the command with the key masked as [REDACTED] - start_command takes an optional redact flag; the execution path (start_command_args array, and the string form on legacy Ruby) keeps the real key, so the tunnel is unaffected - add a redacting #inspect so the key is never dumped by object inspection Proxy password is intentionally left visible (existing behaviour/tests). Adds regression tests that fail on the pre-fix code. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Central YAML (base), Organization UI (inherited), Workspace UI (inherited) Review profile: ASSERTIVE Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
vivianludrick
approved these changes
Sep 22, 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.
What
The public
commandmethod returned the start-command string with the BrowserStack access key interpolated verbatim. Any consumer that logsbs.commandfor debugging — CI output, test-runner logs, or an APM / error tracker (Sentry, Datadog, Rollbar) — writes the credential into a sink that is often readable by a wider audience than the key itself (CWE-312: cleartext exposure of sensitive information). Ruby's default#inspecthad the same problem: logging aLocalinstance, or including it in an exception payload, dumped@key.Changes
commandnow returns the command with the key masked as[REDACTED].start_commandtakes an optionalredactflag (defaultfalse); the execution path (thestart_command_argsarray used on all modern Ruby, and the legacy string form) keeps the real key, so the tunnel is unaffected.#inspectso the access key is never dumped by default object inspection.Verification
commandandinspectshow[REDACTED]on the fix vs the key verbatim before.start_command(execution path) still carries the real key.startconnected (isRunning=true),stopclean, no dangling process.23 runs, 50 assertions, 0 failures.