Skip to content

LOC-6727: validate source URL host before binary download - #176

Open
rounak610 wants to merge 2 commits into
masterfrom
LOC-6727-host-allowlist
Open

rounak610 wants to merge 2 commits into
masterfrom
LOC-6727-host-allowlist

Conversation

@rounak610

Copy link
Copy Markdown
Collaborator

Summary

Mirror the host allowlist added in browserstack-local-java#99 and browserstack-local-python#62. The endpoint returned by the binary endpoint API is now validated in both fetchDownloadSourceUrl.js (sync) and fetchDownloadSourceUrlAsync.js paths before being used to download the binary:

  • must be HTTPS
  • host must be browserstack.com or a *.browserstack.com subdomain

Validator is shared in lib/util.js.

Test plan

  • Unit test: existing tests still pass
  • Manual: normal binary download still works (endpoint resolves under *.browserstack.com)
  • Manual: confirm a synthetic non-allowlisted endpoint throws Refusing binary download: host '...' is not in the allowed host list

🤖 Generated with Claude Code

Mirror the host allowlist added in the Java and Python bindings
(browserstack-local-java#99, browserstack-local-python#62). Refuse
download endpoints that aren't HTTPS or whose host isn't
browserstack.com / *.browserstack.com.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@rounak610
rounak610 requested a review from a team as a code owner June 9, 2026 15:07
@rounak610
rounak610 requested review from amaanbs and kamal-kaur04 June 9, 2026 15:07
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant