Skip to content

Require same-origin stream commands#1355

Merged
ctate merged 2 commits into
mainfrom
ctate/issue-1344
May 13, 2026
Merged

Require same-origin stream commands#1355
ctate merged 2 commits into
mainfrom
ctate/issue-1344

Conversation

@ctate

@ctate ctate commented May 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Require same-origin Origin or Referer metadata before the per-session stream server relays POST /api/command to the daemon.
  • Require the matched command relay authority to be loopback/local to block DNS rebinding hostnames.
  • Restrict command security header lookups to real HTTP headers so request bodies cannot spoof browser metadata.
  • Remove wildcard CORS from /api/command responses while preserving same-origin dashboard command access.
  • Add handler-level and ignored e2e coverage for cross-origin rejection, same-origin relay behavior, DNS rebinding rejection, and header-like body spoofing.

Fixes #1344

Protect the per-session command relay from browser-originated cross-origin requests while preserving same-origin dashboard access.

Co-authored-by: Muhtasham <20128202+Muhtasham@users.noreply.github.com>
@vercel

vercel Bot commented May 13, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agent-browser Ready Ready Preview, Comment May 13, 2026 11:33pm
agent-browser-env-demo Ready Ready Preview, Comment May 13, 2026 11:33pm

Require command relay requests to come from loopback same-origin metadata and prevent request bodies from spoofing security headers.

Co-authored-by: Muhtasham <20128202+Muhtasham@users.noreply.github.com>
@ctate ctate merged commit 55f38f4 into main May 13, 2026
13 checks passed
Karen86Tonoyan added a commit to Karen86Tonoyan/agent-browser that referenced this pull request May 19, 2026
Require same-origin stream commands (vercel-labs#1355)
leeguooooo pushed a commit to leeguooooo/chrome-use that referenced this pull request Jun 1, 2026
* Require same-origin stream commands

Protect the per-session command relay from browser-originated cross-origin requests while preserving same-origin dashboard access.

Co-authored-by: Muhtasham <20128202+Muhtasham@users.noreply.github.com>

* Harden stream command origin checks

Require command relay requests to come from loopback same-origin metadata and prevent request bodies from spoofing security headers.

Co-authored-by: Muhtasham <20128202+Muhtasham@users.noreply.github.com>

---------

Co-authored-by: Muhtasham <20128202+Muhtasham@users.noreply.github.com>
leeguooooo added a commit to leeguooooo/chrome-use that referenced this pull request Jun 1, 2026
Upstream cherry-picks (onto v0.27.0 base):
- security: same-origin stream command relay (vercel-labs#1355)
- feat: hide scrollbars in headless screenshots (vercel-labs#1396)
- chore: pnpm minimum release age + node pinning (vercel-labs#1377, fork-adapted)

Fork fixes:
- fix(connect): stop remote-debugging consent storm — is_connection_alive no
  longer tears down an externally-attached browser on a transient liveness
  timeout (was an endless prompt loop / browser freeze)
- fix(connect): single consenting WebSocket — drop the throwaway verify probe
  so the user's one "Allow remote debugging?" click sticks to the real
  connection
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Per-session /api/command should require same-origin or token auth

1 participant