diff --git a/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php b/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php
index 79db452019ab0..0e0d4f8976233 100644
--- a/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php
+++ b/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php
@@ -162,6 +162,27 @@ public function toolbarAction(Request $request, ?string $token = null): Response
]);
}
+ /**
+ * Renders the Web Debug Toolbar stylesheet.
+ *
+ * @throws NotFoundHttpException
+ */
+ public function toolbarStylesheetAction(): Response
+ {
+ $this->denyAccessIfProfilerDisabled();
+
+ $this->cspHandler?->disableCsp();
+
+ return new Response(
+ $this->twig->render('@WebProfiler/Profiler/toolbar.css.twig'),
+ 200,
+ [
+ 'Content-Type' => 'text/css',
+ 'Cache-Control' => 'max-age=600, private',
+ ],
+ );
+ }
+
/**
* Renders the profiler search bar.
*
@@ -383,6 +404,9 @@ protected function getTemplateManager(): TemplateManager
return $this->templateManager ??= new TemplateManager($this->profiler, $this->twig, $this->templates);
}
+ /**
+ * @throws NotFoundHttpException
+ */
private function denyAccessIfProfilerDisabled(): void
{
if (null === $this->profiler) {
diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/config/routing/wdt.xml b/src/Symfony/Bundle/WebProfilerBundle/Resources/config/routing/wdt.xml
index 0f7e960cc8b91..26bbd96455adf 100644
--- a/src/Symfony/Bundle/WebProfilerBundle/Resources/config/routing/wdt.xml
+++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/config/routing/wdt.xml
@@ -4,6 +4,10 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/routing https://symfony.com/schema/routing/routing-1.0.xsd">
+
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: