diff --git a/formwork/views/errors/partials/debug.php b/formwork/views/errors/partials/debug.php
index fe492edc0..b30280d67 100644
--- a/formwork/views/errors/partials/debug.php
+++ b/formwork/views/errors/partials/debug.php
@@ -1,11 +1,11 @@
-
Uncaught = $throwable::class ?>: = $throwable->getMessage() ?>
+
Uncaught = $throwable::class ?>: = $this->escape($throwable->getMessage()) ?>
$frame) : ?>
attr(['open' => $i === 0]) ?>>
= preg_replace('/([^\/]+)$/', '$1', $frame['file']) ?>:= $frame['line'] ?>
- = Formwork\Debug\CodeDumper::dumpBacktraceFrame($frame, $app->config()->get('system.debug.contextLines', 5)) ?>
+ config()->get('system.debug.contextLines', 5)) ?>
\ No newline at end of file
diff --git a/formwork/views/errors/partials/header.php b/formwork/views/errors/partials/header.php
index 6a70be067..0b803876a 100644
--- a/formwork/views/errors/partials/header.php
+++ b/formwork/views/errors/partials/header.php
@@ -2,7 +2,7 @@
-
= $message ?? 'Internal Server Error' ?> | Formwork
+
= $this->escape($message ?? 'Internal Server Error') ?> | Formwork