Skip to content

Commit 5c3c7c6

Browse files
committed
Bypass port validation for AWS infrastructure domains
Allow AWS services like VPC Lattice to use non-standard ports by skipping port whitelist checks for AWS infrastructure domains. Port restrictions now only apply to non-AWS infrastructure URLs.
1 parent 1adda62 commit 5c3c7c6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

application_src/ui-react-cloudscape/server.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,11 @@ const validateUrl = (url) => {
7070
throw new Error(`Hostname not in whitelist: ${hostname}`);
7171
}
7272

73-
// Additional port restrictions - must be in whitelist
73+
// Additional port restrictions - must be in whitelist for non-AWS infrastructure
7474
const port = parsedUrl.port ? parseInt(parsedUrl.port) : (parsedUrl.protocol === 'https:' ? 443 : 80);
75-
if (parsedUrl.port && !ALLOWED_PORTS.includes(port)) {
75+
76+
// For AWS infrastructure domains, allow any port (VPC Lattice may use non-standard ports)
77+
if (parsedUrl.port && !isAWSInfrastructure && !ALLOWED_PORTS.includes(port)) {
7678
throw new Error(`Port not in whitelist: ${port}`);
7779
}
7880

0 commit comments

Comments
 (0)