Skip to content

fix(cookies): recognize all loopback hosts for secure cookies - #3477

Open
laoyyu wants to merge 1 commit into
browserbase:mainfrom
laoyyu:fix/loopback-secure-cookies
Open

laoyyu wants to merge 1 commit into
browserbase:mainfrom
laoyyu:fix/loopback-secure-cookies

Conversation

@laoyyu

@laoyyu laoyyu commented Nov 17, 2026 •

Copy link
Copy Markdown

Summary

  • recognize *.localhost and every 127.0.0.0/8 address as loopback when filtering cookies
  • add regression coverage for foo.localhost and 127.0.0.2
  • include a patch changeset for the extension and both published SDKs

The extension already treated three loopback spellings as secure-context exceptions, but Playwright and Chromium also treat *.localhost and the full IPv4 loopback range as local. Secure cookies for those hosts were therefore dropped from context.cookies(url) over http:.

Fixes #3469.

Verification

  • pnpm exec vitest run packages/extension/understudy/cookies.test.ts: 25 passed
  • pnpm --filter @browserbasehq/stagehand-extension typecheck: passed
  • pnpm exec oxfmt --check ...: passed
  • pnpm exec oxlint ...: passed

Summary by cubic

Fixes secure cookie filtering so context.cookies(url) keeps secure cookies for *.localhost and all 127.0.0.0/8 hosts when accessed over HTTP.

  • Adds regression tests for foo.localhost and 127.0.0.2.
  • Adds patch changesets for the extension and both published SDKs.

Written for commit 1e6bee8. Summary will update on new commits.

View guided diff

@changeset-bot

changeset-bot Bot commented Nov 17, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1e6bee8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 19 packages
Name Type
@browserbasehq/stagehand-extension Patch
@browserbasehq/stagehand Patch
@browserbasehq/stagehand-python Patch
browse Patch
@browserbasehq/stagehand-examples Patch
@browserbasehq/stagehand-integrations-claude-cua-sdk Patch
@browserbasehq/stagehand-integrations Patch
@browserbasehq/eve Patch
@browserbasehq/stagehand-integrations-gemini-cua-sdk Patch
@browserbasehq/stagehand-integrations-example-pi-facade Patch
@browserbasehq/stagehand-integrations-claude-code Patch
@browserbasehq/stagehand-integrations-codex Patch
@browserbasehq/stagehand-integrations-cursor Patch
@browserbasehq/stagehand-integrations-deepagents-sdk Patch
@browserbasehq/stagehand-integrations-fx Patch
@browserbasehq/stagehand-integrations-mastra Patch
@browserbasehq/stagehand-integrations-pi-sdk Patch
@browserbasehq/stagehand-integrations-example-vercel-ai-facade Patch
@browserbasehq/stagehand-integrations-eve-harness Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

Copy link
Copy Markdown
Contributor

This PR is from an external contributor and must be approved by a stagehand team member with write access before CI can run.
Approving the latest commit mirrors it into an internal PR owned by the approver.
If new commits are pushed later, the internal PR stays open but is marked stale until someone approves the latest external commit and refreshes it.

@github-actions github-actions Bot added external-contributor Tracks PRs mirrored from external contributor forks. external-contributor:awaiting-approval Waiting for a stagehand team member to approve the latest external commit. labels Nov 17, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external-contributor:awaiting-approval Waiting for a stagehand team member to approve the latest external commit. external-contributor Tracks PRs mirrored from external contributor forks.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

context.cookies(url) drops secure cookies for *.localhost and 127.0.0.0/8 hosts

1 participant