This repository was archived by the owner on Nov 7, 2026. It is now read-only.
Repository navigation
fix(network): keep the CORS credentials header out of secret slots - #110
Open
RaphaelFakhri wants to merge 1 commit into
Open
RaphaelFakhri wants to merge 1 commit into
RaphaelFakhri wants to merge 1 commit into
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
The
Access-Control-Allow-Credentialsresponse header name matchescredentialinsecretNamePattern, so network capture stored itstruevalue as a Secret Profile slot. Most credentialedfetch/xhrresponses send this header, so a capture almost always created aBC_SECRET_N=trueslot.While a capture was active, live output redaction then replaced every
truein execute results and logs with the reference. For example,{ visible: true }came back as{ visible: "${BC_SECRET_N}" }.This change adds a small set of header names that match the secret pattern but never carry a credential, starting with
access-control-allow-credentials.protectHeaderreturns those values unchanged.Changes
src/network-redaction.ts: skipaccess-control-allow-credentialsbefore the generic secret-name check.test/network-redaction.test.ts: cover the header value, the slot list, and live output redaction..changeset/cors-credentials-header.md: patch changeset.Testing
npx vitest run test/network-redaction.test.ts: 29 passed. Without the source change, the new test fails ("value": "${BC_SECRET_1}"instead of"true").pnpm check:localsandpnpm check:unusedpass.pnpm test: 993 of 994 passed. The one failure,relay-extension-handshake.test.ts > becomes connected after a compatible extension finishes re-announcement, is timing-sensitive under full-suite load. It passes 3 of 3 runs on its own, with or without this change.Fixes #109