diff options
| author | JP Dillingham <jp@dillingham.me> | 2026-01-15 21:16:28 -0600 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2026-01-15 21:16:28 -0600 |
| commit | b7f7e16ab5bce20b0fad832aff2b2ce64fbbd3fe (patch) | |
| tree | 045af7374a54c5c567f4b69224eb1f13871bda94 /src/slskd | |
| parent | c7517e3beaff7d4754706ec6a709e00955c509e2 (diff) | |
| download | slskd-b7f7e16ab5bce20b0fad832aff2b2ce64fbbd3fe.tar.gz | |
disallow IPv4 mapped IPv6 addresses
Diffstat (limited to 'src/slskd')
| -rw-r--r-- | src/slskd/Core/Options.cs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/slskd/Core/Options.cs b/src/slskd/Core/Options.cs index a1d9953c..68fa4d92 100644 --- a/src/slskd/Core/Options.cs +++ b/src/slskd/Core/Options.cs @@ -648,6 +648,11 @@ namespace slskd { try { + if (cidr.StartsWith("::ffff", StringComparison.OrdinalIgnoreCase)) + { + throw new Exception("IPv4 mapped IPv6 addresses are not allowed"); + } + _ = IPAddressRange.Parse(cidr); } catch (Exception ex) @@ -1116,6 +1121,11 @@ namespace slskd { try { + if (cidr.StartsWith("::ffff", StringComparison.OrdinalIgnoreCase)) + { + throw new Exception("IPv4 mapped IPv6 addresses are not allowed"); + } + _ = IPAddressRange.Parse(cidr); } catch (Exception ex) @@ -2013,6 +2023,11 @@ namespace slskd { try { + if (cidr.StartsWith("::ffff", StringComparison.OrdinalIgnoreCase)) + { + throw new Exception("IPv4 mapped IPv6 addresses are not allowed"); + } + _ = IPAddressRange.Parse(cidr); } catch (Exception ex) @@ -2096,6 +2111,11 @@ namespace slskd { try { + if (cidr.StartsWith("::ffff", StringComparison.OrdinalIgnoreCase)) + { + throw new Exception("IPv4 mapped IPv6 addresses are not allowed"); + } + _ = IPAddressRange.Parse(cidr); } catch (Exception ex) |
