From 4e5b938ebee3020ca91aba7a0e240bf4bd55ccd2 Mon Sep 17 00:00:00 2001 From: Teffen Ellis <592134+GirlBossRush@users.noreply.github.com> Date: Mon, 27 Apr 2026 22:01:20 +0200 Subject: [PATCH] Flesh out CSP. --- authentik/brands/utils.py | 1 + authentik/core/templates/base/header_js.html | 2 +- authentik/core/templates/base/skeleton.html | 3 ++- authentik/core/templates/base/theme.html | 4 ++-- authentik/core/templates/login/base_full.html | 2 +- authentik/flows/templates/flows/frame-submit.html | 2 +- authentik/flows/templates/if/flow-sfe.html | 14 +++++++------- authentik/flows/templates/if/flow.html | 10 +++++----- web/src/admin/events/EventMap.ts | 4 ++-- web/src/flow/sources/apple/AppleLoginInit.ts | 1 + web/src/flow/sources/telegram/utils.ts | 2 ++ web/src/flow/stages/captcha/CaptchaStage.ts | 1 + 12 files changed, 26 insertions(+), 20 deletions(-) diff --git a/authentik/brands/utils.py b/authentik/brands/utils.py index 9b2b5be65c..2487653cb7 100644 --- a/authentik/brands/utils.py +++ b/authentik/brands/utils.py @@ -66,4 +66,5 @@ def context_processor(request: HttpRequest) -> dict[str, Any]: "footer_links": tenant.footer_links, "html_meta": {**get_http_meta()}, "version": authentik_full_version(), + "csp_nonce": request.request_id, } diff --git a/authentik/core/templates/base/header_js.html b/authentik/core/templates/base/header_js.html index 39dc374cf0..cc5b673258 100644 --- a/authentik/core/templates/base/header_js.html +++ b/authentik/core/templates/base/header_js.html @@ -1,7 +1,7 @@ {% load i18n %} {% get_current_language as LANGUAGE_CODE %} - {% block title %}{% trans title|default:brand.branding_title %}{% endblock %} @@ -27,7 +28,7 @@ {% include "base/theme.html" %} - + {% block head %} {% endblock %} diff --git a/authentik/core/templates/base/theme.html b/authentik/core/templates/base/theme.html index 9be2091e13..d36d844ea2 100644 --- a/authentik/core/templates/base/theme.html +++ b/authentik/core/templates/base/theme.html @@ -9,7 +9,7 @@ {% else %} - -
-
-
- {% trans 'Powered by authentik' %} -
- +
+
+
+ {% trans 'Powered by authentik' %} +
diff --git a/authentik/flows/templates/if/flow.html b/authentik/flows/templates/if/flow.html index ea5d0f60cb..3ad081d54e 100644 --- a/authentik/flows/templates/if/flow.html +++ b/authentik/flows/templates/if/flow.html @@ -12,7 +12,7 @@ {% comment %} @see {@link web/types/webcomponents.d.ts} for type definitions. {% endcomment %} - {% endif %} {% include "base/header_js.html" %} - - -