fix(security): require https for trusted links
This commit is contained in:
1 parent
4e5af2b45f
commit
2ab001b18a
3 files changed
+15
-2
No files matched your search
@@ -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 };
|
||||
|
||||
Reference in new issue
Block a user