Skip to content

[codex] Reject unsupported remote pairing protocols#3498

Merged
juliusmarminge merged 3 commits into
pingdotgg:mainfrom
StiensWout:staging/reject-unsupported-remote-pairing-protocols
Jun 22, 2026
Merged

[codex] Reject unsupported remote pairing protocols#3498
juliusmarminge merged 3 commits into
pingdotgg:mainfrom
StiensWout:staging/reject-unsupported-remote-pairing-protocols

Conversation

@StiensWout

@StiensWout StiensWout commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Reject unsupported remote backend protocols during remote pairing resolution.
  • Keep accepted backend protocols to http:, https:, ws:, and wss: while preserving bare-host https:// defaults.
  • Add focused coverage for unsupported direct pairing URLs, hosted backend hosts, and direct host inputs.

Root cause

Remote pairing URL parsing accepted any syntactically valid URL protocol. Unsupported schemes such as ftp: could pass through direct pairing resolution or normalized backend host resolution and produce backend base URLs that the app cannot use.

Impact

Invalid remote pairing targets now fail early with the existing structured errors. Direct unsupported pairing URLs throw RemotePairingUrlInvalidError; unsupported hosted or direct backend host inputs throw RemoteBackendUrlInvalidError with their existing source metadata preserved.

Validation

  • PATH="$HOME/.vite-plus/bin:$PATH" vp test packages/shared/src/remote.test.ts passed: 1 file passed, 10 tests passed
  • PATH="$HOME/.vite-plus/bin:$PATH" vp check passed: 0 errors; 20 existing unrelated warnings
  • PATH="$HOME/.vite-plus/bin:$PATH" vp run typecheck passed: completed successfully

Note

Low Risk
Input validation only in shared pairing URL parsing; behavior tightens for invalid schemes without changing auth or connection logic for supported protocols.

Overview
Remote pairing resolution no longer accepts arbitrary URL schemes that parse successfully but cannot be used as HTTP/WebSocket backends.

resolveRemotePairingTarget and normalizeRemoteBaseUrl now allow only http:, https:, ws:, and wss: (bare hosts still default to https://). Unsupported schemes such as ftp: fail early with the existing RemotePairingUrlInvalidError or RemoteBackendUrlInvalidError, optionally carrying a protocol field; parse failures still attach a cause as before.

Tests cover unsupported protocols on direct pairing URLs, hosted pairing host parameters, and direct host inputs.

Reviewed by Cursor Bugbot for commit 43dca40. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Reject unsupported protocols in remote pairing and backend URL validation

  • Adds SUPPORTED_REMOTE_BACKEND_PROTOCOLS (http:, https:, ws:, wss:) as the allowlist for remote backend URLs in remote.ts.
  • normalizeRemoteBaseUrl now throws RemoteBackendUrlInvalidError (with protocol, no cause) when the parsed URL has an unsupported protocol.
  • resolveRemotePairingTarget now throws RemotePairingUrlInvalidError (with protocol, no cause) for unsupported pairing URL protocols; hosted pairing links with an unsupported backend host protocol surface as RemoteBackendUrlInvalidError with source: 'hosted-pairing-host'.
  • cause is now optional on both error classes, and both gain an optional protocol field.
  • Behavioral Change: URLs with protocols such as ftp: now throw structured errors instead of being accepted or failing with a generic parse error.

Macroscope summarized 43dca40.

StiensWout and others added 2 commits June 22, 2026 08:27
Co-authored-by: Codex <codex@openai.com>
…mote-pairing-protocols

[codex] Reject unsupported remote pairing protocols
@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: f9e4a33f-93c6-4b00-b0df-7c70d99bc47e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Jun 22, 2026

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Effect Service Conventions

1 finding. See the inline comment on packages/shared/src/remote.ts.

Posted via Macroscope — Effect Service Conventions

Comment thread packages/shared/src/remote.ts Outdated
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Jun 22, 2026
@macroscopeapp

macroscopeapp Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved

This PR adds input validation to reject unsupported URL protocols (e.g., ftp:) for remote pairing, which is a security-hardening change with clear intent, limited scope, and comprehensive test coverage.

You can customize Macroscope's approvability policy. Learn more.

Co-authored-by: Codex <codex@openai.com>
@macroscopeapp macroscopeapp Bot dismissed their stale review June 22, 2026 08:54

Dismissing prior approval to re-evaluate 43dca40

@juliusmarminge juliusmarminge merged commit 8919ae7 into pingdotgg:main Jun 22, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants