[Security] Restrict default CORS origins (#61009)

Signed-off-by: Juan Pérez de Algaba <jperezde@redhat.com>
Co-authored-by: Cyrus Leung <tlleungac@connect.ust.hk>
This commit is contained in:
Juan Pérez de Algaba
2026-10-11 08:26:02 +00:00
committed by GitHub
co-authored by Cyrus Leung
parent 26a488ad93
commit fcae5c9887
8 changed files with 124 additions and 37 deletions
+2 -2
View File
@@ -316,8 +316,8 @@ class FrontendArgs(BaseFrontendArgs):
while keeping logs for other endpoints."""
allow_credentials: bool = False
"""Allow credentials."""
allowed_origins: list[str] = field(default_factory=lambda: ["*"])
"""Allowed origins."""
allowed_origins: list[str] = field(default_factory=list)
"""Allowed origins. Cross-origin browser access is disabled by default."""
allowed_methods: list[str] = field(default_factory=lambda: ["*"])
"""Allowed methods."""
allowed_headers: list[str] = field(default_factory=lambda: ["*"])