fix(sandbox): require https for vercel exposed port domains#3258
Closed
adityasingh2400 wants to merge 1 commit into
Closed
fix(sandbox): require https for vercel exposed port domains#3258adityasingh2400 wants to merge 1 commit into
adityasingh2400 wants to merge 1 commit into
Conversation
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.
Member
|
@codex review |
|
Codex Review: Didn't find any major issues. Breezy! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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
VercelSandboxSession._resolve_exposed_portaccepted any URL returned bysandbox.domain()— includinghttp://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, raisingExposedPortUnavailableErrorvia the same path already used for missing/invalid hostnames, and drops the conditionalhttp/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: newtest_vercel_resolve_exposed_port_rejects_non_https_domainplusExposedPortUnavailableErrorimport.Test plan
test_vercel_resolve_exposed_port_rejects_non_https_domainfails onmainand passes after the fix.tests/extensions/sandbox/test_vercel.pysuite (35 tests) passes.ruff checkandruff format --checkclean on both files.🤖 Generated with Claude Code