Skip to content

chore: verify port status#53

Open
tarushi-sf wants to merge 1 commit into
mainfrom
tarushi/port-squatting
Open

chore: verify port status#53
tarushi-sf wants to merge 1 commit into
mainfrom
tarushi/port-squatting

Conversation

@tarushi-sf
Copy link
Copy Markdown
Collaborator

@tarushi-sf tarushi-sf commented May 18, 2026

Fix: Port Squatting — Token-Based Server Identity Verification

Problem

When sf ui-bundle dev starts, it checks if the target port is already reachable. If so, it skips starting a new server and uses the existing one. A malicious process can exploit this.

Fix

The CLI now generates a unique UUID token at startup and passes it to the dev server through the process environment. The dev server includes this token in a response header on its health check endpoint. Before using any already-running server, the CLI fetches the health check and compares the token. If it matches, the server was started by us — proceed normally. If it doesn't match (or the header is absent), the server is unverified — the CLI aborts immediately with a clear error.

Changes in other repo's:

PR link in webapps: PR#523
PR link in salesforcedx-vscode-ui-preview: PR#122

Before:

Screen.Recording.2026-05-18.at.8.46.17.PM.mov

Idea:

Screen.Recording.2026-05-18.at.9.42.35.PM.mov

After:

Screen.Recording.2026-05-18.at.9.55.09.PM.mov

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.

1 participant