Skip to content
This repository was archived by the owner on Nov 7, 2026. It is now read-only.

fix(network): keep the CORS credentials header out of secret slots - #110

Open
RaphaelFakhri wants to merge 1 commit into
anomalyco:mainfrom
RaphaelFakhri:fix/cors-credentials-header-not-secret
Open

RaphaelFakhri wants to merge 1 commit into
anomalyco:mainfrom
RaphaelFakhri:fix/cors-credentials-header-not-secret

Conversation

@RaphaelFakhri

Copy link
Copy Markdown

Summary

The Access-Control-Allow-Credentials response header name matches credential in secretNamePattern, so network capture stored its true value as a Secret Profile slot. Most credentialed fetch/xhr responses send this header, so a capture almost always created a BC_SECRET_N=true slot.

While a capture was active, live output redaction then replaced every true in 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. protectHeader returns those values unchanged.

Changes

  • src/network-redaction.ts: skip access-control-allow-credentials before 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:locals and pnpm check:unused pass.
  • 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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Network capture stores the CORS Access-Control-Allow-Credentials: true response header as a secret

1 participant