Skip to content

fix(forward): reject invalid TCP targets before local bind - #5115

Open
shiju-nv wants to merge 1 commit into
NVIDIA:mainfrom
shiju-nv:fix/5112-forward-target-preflight/shiju-nv
Open

shiju-nv wants to merge 1 commit into
NVIDIA:mainfrom
shiju-nv:fix/5112-forward-target-preflight/shiju-nv

Conversation

@shiju-nv

@shiju-nv shiju-nv commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

An invalid TCP relay target can reach the gateway or open a local listener before failing. This rejects it in the CLI and TypeScript SDK first, then preserves the normalized target through the handle and relay request. The gateway continues to validate every target.

Related Issue

Closes #5112. Part of #5114.

Changes

  • Accept supported localhost aliases, IPv4 loopback and IPv6 loopback without DNS resolution.
  • Reject empty, non-loopback, mapped, scoped or malformed hosts and invalid ports before gateway lookup or local bind.
  • Share the Rust loopback normalization primitive between CLI and gateway.

Release Notes

Invalid TCP targets fail immediately with a configuration error. SSH relay targets keep their existing path.

Testing

  • Checks appropriate to the affected code and behavior pass
  • Unit tests added/updated (if applicable)
  • E2E tests added/updated (if applicable)

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Architecture docs updated (if applicable)

@shiju-nv shiju-nv added the test:e2e Requires end-to-end coverage label Nov 2, 2026
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown

Label test:e2e applied for 439c081. Open the existing run and click Re-run all jobs to execute with the label set. The run will execute the standard E2E suite after building the required gateway, sandbox, and supervisor images once. The matching required CI gate status on this PR will flip green automatically once the run finishes.

@shiju-nv
shiju-nv force-pushed the fix/5112-forward-target-preflight/shiju-nv branch from 439c081 to 2725f40 Compare November 2, 2026 14:46
An invalid TCP relay target can reach the gateway or open a local listener before failing. This rejects it in the CLI and TypeScript SDK first, then preserves the normalized target through the handle and relay request. The gateway continues to validate every target.

Signed-off-by: Shiju <shiju@nvidia.com>
@shiju-nv
shiju-nv force-pushed the fix/5112-forward-target-preflight/shiju-nv branch from 2725f40 to 84eafe7 Compare November 3, 2026 11:47
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

Compatibility review (advisory)

New or updated breaking changes; see the full report for all findings.

1. typescript-sdk — No explicit risk acceptance found

SandboxClient.forward previously returned the supplied ForwardHandle.targetHost unchanged but now replaces localhost with 127.0.0.1 and expanded IPv6 loopback with ::1.

  • Impact: Callers comparing or indexing ForwardHandle.targetHost against their configured targetHost no longer match for these otherwise valid forwarding targets.
  • Action: Preserve the original ForwardHandle.targetHost value in v0.1.7 while using a separate normalized host for validation and relay requests.
  • PR: fix(forward): reject invalid TCP targets before local bind #5115
Review details
  • Execution: complete
  • Candidate: PR #5115 (bd8d2daefa219657258ad16373a0544d551dda38)
  • Baseline: cc0642fa8955be9db480937193693968ada92a49 (cc0642fa8955be9db480937193693968ada92a49)
  • Reviewed: rust-sdk, python-sdk, go-sdk, typescript-sdk, api-behavior, cli, configuration, policy, helm, state

Advisory review; publication gates are unchanged.

Branch check run

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

test:e2e Requires end-to-end coverage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reject invalid TCP targets before opening a local forward

1 participant