From f416b0aed1d5fdec587c765cce7ee4bd45a1d66b Mon Sep 17 00:00:00 2001 From: 3252a8 <3252a8@proton.me> Date: Mon, 27 Apr 2026 09:34:09 +0300 Subject: [PATCH] fix(webapp): allow oauth.telegram.org iframe in CSP The Telegram Login Widget embeds oauth.telegram.org in an iframe; without an explicit frame-src directive it fell back to default-src 'self' and was blocked. Add frame-src https://oauth.telegram.org so the login flow loads. --- bot/app/web/subscription_webapp.py | 1 + 1 file changed, 1 insertion(+) diff --git a/bot/app/web/subscription_webapp.py b/bot/app/web/subscription_webapp.py index 3d1f96a..d2a10c7 100644 --- a/bot/app/web/subscription_webapp.py +++ b/bot/app/web/subscription_webapp.py @@ -348,6 +348,7 @@ async def _security_headers_middleware(request: web.Request, handler): ( "default-src 'self'; " f"script-src 'self' 'nonce-{nonce}' 'unsafe-eval' https://telegram.org; " + "frame-src https://oauth.telegram.org; " "frame-ancestors https://web.telegram.org https://t.me; " "style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; " "font-src 'self' https://fonts.gstatic.com https://cdn.jsdelivr.net data:; "