Skip to content

Commit cf53cbe

Browse files
author
Nitin Chaudhary
committed
Fix IPv6 loopback expanded form detection
- Add check for 0:0:0:0:0:0:0:1 (expanded form of ::1) - Fixes URLValidatorTest.BlocksIPv6Loopback
1 parent a74dae8 commit cf53cbe

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

vnext/Shared/InputValidation.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,11 @@ bool URLValidator::IsPrivateOrLocalhost(const std::string &hostname) {
203203
return true;
204204
}
205205

206+
// Check IPv6 loopback in expanded form (0:0:0:0:0:0:0:1)
207+
if (hostname == "0:0:0:0:0:0:0:1") {
208+
return true;
209+
}
210+
206211
// Check for encoded IPv4 formats (SDL requirement)
207212
if (IsOctalIPv4(hostname) || IsHexIPv4(hostname) || IsDecimalIPv4(hostname)) {
208213
LogValidationFailure("ENCODED_IP", "Blocked encoded IP format: " + hostname);

0 commit comments

Comments
 (0)