diff --git a/application/dashlet.class.inc.php b/application/dashlet.class.inc.php
index e22b02525..63a1f9413 100644
--- a/application/dashlet.class.inc.php
+++ b/application/dashlet.class.inc.php
@@ -849,6 +849,7 @@ class DashletPlainText extends Dashlet
public function Render($oPage, $bEditMode = false, $aExtraParams = array())
{
$sText = $this->aProperties['text'];
+ $sText = utils::EscapeHtml($sText);
$sText = str_replace(array("\r\n", "\n", "\r"), "
", $sText);
$sId = 'plaintext_'.($bEditMode ? 'edit_' : '').$this->sId;
diff --git a/templates/base/components/dashlet/dashlet-plain-text.html.twig b/templates/base/components/dashlet/dashlet-plain-text.html.twig
index c4e372de6..619c646b5 100644
--- a/templates/base/components/dashlet/dashlet-plain-text.html.twig
+++ b/templates/base/components/dashlet/dashlet-plain-text.html.twig
@@ -1,5 +1,8 @@
{# @copyright Copyright (C) 2010-2021 Combodo SARL #}
{# @license http://opensource.org/licenses/AGPL-3.0 #}
{% apply spaceless %}
-