Skip to content

Commit e8ef5b6

Browse files
fix(validation): cap endpoint/peer port regex at 65535
Replace \d{1,5} (0-99999) with a bounded 0-65535 matcher in the grpc, grpc-web and peer patterns of checkEndpointAddressFormat. Addresses Greptile review note: ports 65536-99999 previously passed validation. Registry-wide scan confirms zero valid entries affected. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 5f7f238 commit e8ef5b6

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

.github/workflows/utility/validate_data.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -336,10 +336,10 @@ function checkEndpointAddressFormat(id, context, objectType, checks, errorMsgs)
336336
"rest": /^https?:\/\/\S+$/,
337337
"evm-http-jsonrpc": /^https?:\/\/\S+$/,
338338
"wss": /^wss?:\/\/\S+$/,
339-
"grpc": /^(https?:\/\/\S+|[^\s/]+:\d{1,5})$/,
340-
"grpc-web": /^(https?:\/\/\S+|[^\s/]+:\d{1,5})$/,
339+
"grpc": /^(https?:\/\/\S+|[^\s/]+:(?:[0-9]{1,4}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5]))$/,
340+
"grpc-web": /^(https?:\/\/\S+|[^\s/]+:(?:[0-9]{1,4}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5]))$/,
341341
};
342-
const peerPattern = /^[^\s/]+:\d{1,5}$/;
342+
const peerPattern = /^[^\s/]+:(?:[0-9]{1,4}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])$/;
343343
const expected = (t) => t === "wss" ? "a ws(s):// URL"
344344
: (t === "grpc" || t === "grpc-web") ? "an http(s):// URL or host:port"
345345
: "an http(s):// URL";

0 commit comments

Comments
 (0)