Skip to content

fix(sandbox): require https for vercel exposed port domains#3258

Closed
adityasingh2400 wants to merge 1 commit into
openai:mainfrom
adityasingh2400:fix/sandbox-vercel-https-port
Closed

fix(sandbox): require https for vercel exposed port domains#3258
adityasingh2400 wants to merge 1 commit into
openai:mainfrom
adityasingh2400:fix/sandbox-vercel-https-port

Conversation

@adityasingh2400
Copy link
Copy Markdown
Contributor

Summary

VercelSandboxSession._resolve_exposed_port accepted any URL returned by sandbox.domain() — including http:// or schemeless — and silently exposed it as a non-TLS endpoint (tls=False, port 80). Vercel sandbox preview domains are always served over HTTPS, so a non-https scheme indicates either a backend bug or a tampered response. Either way, downstream code would then connect over plaintext to a host derived from that URL.

This change rejects any domain whose scheme is not https, raising ExposedPortUnavailableError via the same path already used for missing/invalid hostnames, and drops the conditional http/port-80 fallback.

This is in the same vein as #3206 (and earlier #3094 / #3172 / #3177) — defensive narrowing of what a sandbox backend will trust from the wire.

Diff

  • src/agents/extensions/sandbox/vercel/sandbox.py: 7 lines changed (require https in _resolve_exposed_port).
  • tests/extensions/sandbox/test_vercel.py: new test_vercel_resolve_exposed_port_rejects_non_https_domain plus ExposedPortUnavailableError import.

Test plan

  • New unit test test_vercel_resolve_exposed_port_rejects_non_https_domain fails on main and passes after the fix.
  • Full tests/extensions/sandbox/test_vercel.py suite (35 tests) passes.
  • ruff check and ruff format --check clean on both files.

🤖 Generated with Claude Code

VercelSandboxSession._resolve_exposed_port accepted any URL returned by
sandbox.domain() — including http:// or schemeless — and silently exposed
it as a non-TLS endpoint (tls=False, port 80). Vercel sandbox preview
domains are always served over HTTPS, so a non-https scheme indicates
either a backend bug or a tampered response. Either way, downstream code
would then connect over plaintext to a host derived from that URL.

Reject any domain whose scheme is not https with the existing
ExposedPortUnavailableError path, and drop the conditional http fallback
for tls/port. Mirrors the same defensive narrowing applied to the daytona
backend in openai#3206.
@seratch
Copy link
Copy Markdown
Member

seratch commented May 8, 2026

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@seratch seratch added the wontfix This will not be worked on label May 8, 2026
@seratch seratch closed this May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working feature:extensions feature:sandboxes wontfix This will not be worked on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants