Web panel: IsAllowed fails closed on invalid IDN hosts
Uri.IdnHost throws UriFormatException for hosts like c<U+2100>; catch and reject. Test project now runs with ICU so the case is covered. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
0b0d2cb072
commit
e428f65c4d
3 changed files with 6 additions and 2 deletions
|
|
@ -71,6 +71,7 @@ internal static class Program
|
|||
})
|
||||
Check(!WebPanelUrlPolicy.IsAllowed(u, Dw), "rejects " + u);
|
||||
Check(!WebPanelUrlPolicy.IsAllowed("https://www.acdreamweave.com/" + new string('a', 5000), Dw), "over MaxUrlBytes rejected");
|
||||
Check(!WebPanelUrlPolicy.IsAllowed("https://www.acdreamweave.c\u2100/", Dw), "invalid IDN char fails closed (no throw)");
|
||||
}
|
||||
|
||||
private static void Allowlist_CaseIdnTrailingDot()
|
||||
|
|
|
|||
|
|
@ -11,7 +11,8 @@
|
|||
<TargetFramework>net10.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<InvariantGlobalization>true</InvariantGlobalization>
|
||||
<!-- ICU on: invariant mode skips IDN validation and hides Uri.IdnHost throwing. -->
|
||||
<InvariantGlobalization>false</InvariantGlobalization>
|
||||
<RootNamespace>WebPanelTests</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue