chore: verify port status#53
Open
tarushi-sf wants to merge 1 commit into
Open
Conversation
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.
Fix: Port Squatting — Token-Based Server Identity Verification
Problem
When
sf ui-bundle devstarts, 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