Skip to content

Commit 37ef6ad

Browse files
[APS-19009] sync securityValidation.js with #1141 (IPv6 [::1] allowlist fix)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent fba71e0 commit 37ef6ad

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

bin/helpers/securityValidation.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ const path = require('path');
1818
// production, staging (bsstag.com) and local development. Anything else is
1919
// treated as attacker-controlled and rejected.
2020
const ALLOWED_HOST_SUFFIXES = ['.browserstack.com', '.bsstag.com'];
21-
const ALLOWED_EXACT_HOSTS = ['browserstack.com', 'bsstag.com', 'localhost', '127.0.0.1', '::1'];
21+
// Note: URL parsing yields '[::1]' (bracketed) as the hostname for IPv6 loopback.
22+
const ALLOWED_EXACT_HOSTS = ['browserstack.com', 'bsstag.com', 'localhost', '127.0.0.1', '[::1]'];
2223

2324
/**
2425
* Returns true if the given URL points at a BrowserStack (prod/staging) host or

0 commit comments

Comments
 (0)