fix(security): require https for trusted links

This commit is contained in:
ZacharyZhang-NY committed 2026-05-15 02:56:25 -04:00
1 parent 4e5af2b45f
commit 2ab001b18a
3 files changed
+15 -2

No files matched your search

+1 -1
View File
@@ -47,7 +47,7 @@ export function classifyExternalUrl(rawUrl: string): ExternalUrlDecision {
}
const parsed = new URL(normalized);
const host = parsed.hostname.toLowerCase();
if (TRUSTED_EXTERNAL_HOSTS.has(host)) {
if (parsed.protocol === "https:" && TRUSTED_EXTERNAL_HOSTS.has(host)) {
return { kind: "trusted", url: normalized, host };
}
return { kind: "confirm", url: normalized, host };