Skip to content

Voice-to-text dictation app with local (Nvidia Parakeet/Whisper) and cloud models (BYOK). Privacy-first and available cross-platform.

fix(network): treat the full IPv6 link-local range as private HTTP (#1733)

Henry Su1fe91f215832
diff --git a/src/utils/urlUtils.ts b/src/utils/urlUtils.ts
index 4588d6e91..2feeff306 100644
--- a/src/utils/urlUtils.ts
+++ b/src/utils/urlUtils.ts
@@ -36,7 +36,9 @@ function isPrivateHost(hostname: string): boolean {
}
const isIPv6 = h.includes(":");
- if (isIPv6 && (h.startsWith("fe80") || h.startsWith("fc") || h.startsWith("fd"))) return true;
+ // Link-local is fe80::/10 (fe80–febf), not only the fe80 hextet. Same rule as
+ // isPrivateIp in urlAudioDownloader.js. Unique local is fc00::/7 (fc/fd).
+ if (isIPv6 && (/^fe[89ab]/.test(h) || h.startsWith("fc") || h.startsWith("fd"))) return true;
if (h.endsWith(".local")) return true;
// Tailscale MagicDNS — resolves to CGNAT (100.64/10) addresses reachable
// only inside the user's own tailnet.
diff --git a/test/helpers/secureEndpoint.test.js b/test/helpers/secureEndpoint.test.js
index 84c6f1571..0ff068f66 100644
--- a/test/helpers/secureEndpoint.test.js
+++ b/test/helpers/secureEndpoint.test.js
@@ -75,6 +75,10 @@ test("link-local, IPv6 ULA, and .local hostnames are allowed over http", async (
assert.equal(isSecureHttpEndpoint("http://169.254.1.1:8080"), true);
assert.equal(isSecureHttpEndpoint("http://[fe80::1]:8080"), true);
+ assert.equal(isSecureHttpEndpoint("http://[fe90::1]:8080"), true);
+ assert.equal(isSecureHttpEndpoint("http://[fea0::1]:8080"), true);
+ assert.equal(isSecureHttpEndpoint("http://[febf::1]:8080"), true);
+ assert.equal(isSecureHttpEndpoint("http://[fe7f::1]:8080"), false);
assert.equal(isSecureHttpEndpoint("http://[fc00::1]:8080"), true);
assert.equal(isSecureHttpEndpoint("http://[fd12::1]:8080"), true);
assert.equal(isSecureHttpEndpoint("http://myserver.local:8080"), true);