Skip to content

Open-source AI podcast clipper. Generate vertical clips with face tracking and burned-in captions. CLI, MCP server, web app.

Trust Hugging Face CDN redirect hosts in model downloader (#32)

Nika Siradze00578fd1c9c2
diff --git a/cli/internal/provision/provision.go b/cli/internal/provision/provision.go
index b5628f6..766c14c 100644
--- a/cli/internal/provision/provision.go
+++ b/cli/internal/provision/provision.go
@@ -369,6 +369,7 @@ func allowedDownloadHost(h string) bool {
"github.com", // release assets
"githubusercontent.com", // objects.* / release-assets.* CDN
"huggingface.co", // whisper.cpp models + cdn-lfs*.huggingface.co
+ "hf.co", // HF CDN redirects: us.aws.cdn.hf.co, cas-bridge.xethub.hf.co
"nodejs.org", // hermetic Node
"evermeet.cx", // macOS ffmpeg
"johnvansickle.com", // linux ffmpeg
diff --git a/cli/internal/provision/redirect_test.go b/cli/internal/provision/redirect_test.go
index 8e03c9e..a04118b 100644
--- a/cli/internal/provision/redirect_test.go
+++ b/cli/internal/provision/redirect_test.go
@@ -10,6 +10,7 @@ func TestAllowedDownloadHost(t *testing.T) {
allow := []string{
"github.com", "objects.githubusercontent.com", "release-assets.githubusercontent.com",
"huggingface.co", "cdn-lfs.huggingface.co", "cdn-lfs-us-1.huggingface.co",
+ "hf.co", "us.aws.cdn.hf.co", "cas-bridge.xethub.hf.co",
"nodejs.org", "evermeet.cx", "johnvansickle.com", "www.johnvansickle.com",
}
for _, h := range allow {
@@ -20,7 +21,7 @@ func TestAllowedDownloadHost(t *testing.T) {
// Suffix spoofing must not pass: a trusted name as a left-label is not enough.
deny := []string{
"evil.com", "github.com.evil.com", "huggingface.co.attacker.net",
- "githubusercontent.com.evil.com", "127.0.0.1", "",
+ "githubusercontent.com.evil.com", "hf.co.attacker.net", "127.0.0.1", "",
}
for _, h := range deny {
if allowedDownloadHost(h) {